install webpack
npm install --save-dev webpack
# or specific version
npm install --save-dev webpack@<version>
install webpack
npm install --save-dev webpack
# or specific version
npm install --save-dev webpack@<version>
what is webpack.js
// Based on the provided configuration (webpack.config.js),
// webpack starts from the entry points and resolves each module it
// encounters while constructing the dependency graph
// entry points
// the entry point is the module that webpack uses to start building its internal dependency graph.
entry: {
'app': glob.sync('./vendor/**/*.js').concat(['./js/app.js'])
},
// output point
// the output property instructs webpack where to emit the bundle(s) and what name to use for the file(s)
output: {
filename: '[name].js',
path: path.resolve(__dirname, '../priv/static/js'),
publicPath: '/js/'
},
// dependency graph
// From the entry point, webpack will configure a set of nodes connected to one
// another as dependencies and will compile that to the output point
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us