- Broke our webpack.config file into 3 files - webpack.common.js, webpack.dev.js, and webpack.prod.js - installed webpack-merge to share the common functionality - updated our package.json to use the new config files - installed webpack-dev-server and added it to start script in package.json
24 lines
484 B
JavaScript
24 lines
484 B
JavaScript
const path = require("path");
|
|
var HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
|
|
module.exports = {
|
|
entry: "./src/index.js",
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
template: "./src/template.html"
|
|
})
|
|
],
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.scss$/,
|
|
use: [
|
|
"style-loader", //3. Inject styles into DOM
|
|
"css-loader", //2. Turns css into commonjs
|
|
"sass-loader" //1. Turns sass into css
|
|
]
|
|
}
|
|
]
|
|
}
|
|
};
|