Last active
March 21, 2019 14:50
-
-
Save misterdev/94b80ac3a5290d97d0511791fedbdca9 to your computer and use it in GitHub Desktop.
webpack config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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