생성
설치
npm init
npm i -D webpack webpack-cli webpack-dev-server@next
webpack: core
webpack-cli: command line interface
webpack-dev-server: dev-server
config
const path = require('path')
module.exports = {
entry: './js/main.js',
output: {
path: path.resolve(__dirname, 'public'),
filename: 'main.js'
clean: true
}
}
[webpack entry docs](https://webpack.js.org/configuration/entry-context/#entry-descriptor)
plugin
npm i -D html-webpack-plugin
const HtmlPlugin = require('html-webpack-plugin')
const CopyPlugin = require('copy-webpack-plugin')
plugins: [
new HtmlPlugin({
template: './index.html'
}),
new CopyPlugin({
patterns: [
{ from: 'static' }
]
})
]
pull
//degit
npx degit github_name/repository_name dir_name