Skip to content

Instantly share code, notes, and snippets.

@pinglinh
Last active March 12, 2018 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pinglinh/9dbdd0e65f5ee6e6f0fe12b52eb2879f to your computer and use it in GitHub Desktop.
Save pinglinh/9dbdd0e65f5ee6e6f0fe12b52eb2879f to your computer and use it in GitHub Desktop.
const HtmlWebPackPlugin = require("html-webpack-plugin");
const htmlWebpackPlugin = new HtmlWebPackPlugin({
template: "./src/index.html",
filename: "./index.html"
});
module.exports = {
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /\.css$/,
use: [
{
loader: "style-loader"
},
{
loader: "css-loader",
options: {
modules: true,
importLoaders: 1,
localIdentName: "[name]_[local]_[hash:base64]",
sourceMap: true,
minimize: true
}
}
]
}
]
},
plugins: [htmlWebpackPlugin]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment