Skip to content

Instantly share code, notes, and snippets.

@misterdev
Last active March 21, 2019 14:50
Show Gist options
  • Save misterdev/94b80ac3a5290d97d0511791fedbdca9 to your computer and use it in GitHub Desktop.
Save misterdev/94b80ac3a5290d97d0511791fedbdca9 to your computer and use it in GitHub Desktop.
webpack config
module.exports = (answers) => {
const { name, entry, inFolder: src, outFolder: dist, publicFolder } = answers;
return {
entry: `"./${src}/${entry}.js"`,
mode: '"development"',
module: {
rules: [{
test: "/\\.js$/",
exclude: "/node_modules/",
loader: '"babel-loader"',
},
/* ... */
},
plugins: [
"new VueLoaderPlugin()",
`new HtmlWebpackPlugin({
templateParameters: {
PROJECT_NAME: "${name}"
},
template: './${publicFolder}/index.html',
})`,
`new CopyWebpackPlugin([{
from: './${publicFolder}',
to: './${dist}',
toType: 'dir',
ignore: ['.DS_Store'],
}])`,
],
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment