Closed ckornell closed 5 years ago
@ckornell, made some more minor comments. If you can add a test I'll look into the comments myself, of course you're free to fix them as well ✌️
Hey @cascornelissen, I made the changes you requested and pushed up the commit. I attempted to write a test, but I'm afraid I'm too new to webpack plugin development to figure it out. Here's what I tried...
it('Deletes sourcemap files if it exists', async () => {
webpack({
entry: './webpack/index.js',
mode: 'development',
plugins: [
new SVGSpritemapPlugin({
output: {
filename: path.join(__dirname, 'output/svg/test.svg')
}
})
]
});
const outputSourceMap = fs.existsSync(path.join(__dirname, 'output/svg/test.map'));
expect(outputSourceMap).toBeFalsy();
})
Probably need to wait for webpack but am not sure how to do that here. Sorry!
LGTM 👍 Don't worry about the test too much, I can finish that part up as well this weekend when I hope to merge and release this change.
There's some tests that kick off webpack here if you still want to try 😉 https://github.com/cascornelissen/svg-spritemap-webpack-plugin/blob/master/tests/svg4everybody-helper.test.js
Hey @cascornelissen, I added some working tests. I'm sure they could be done better. I figured since we're testing the sourcemap file we should do the same for the JS file, so I added that too. Thanks for all your help! Let me know if I can do anything else. Have a great weekend.
@ckornell, thanks one last time for your contribution! ✌️ I've cleaned some stuff up (in 701c3e5 if you're interested) and added some more (unrelated) test cases and this has been released in 3.3.5
🚀
In dev mode, I kept getting a .map file, and deleting the file again & again got to be a tab cumbersome. Let me know if you want this handled differently; I would love not to use a fork for something this simple. Thanks for this awesome plugin!