You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
923 B
JavaScript
51 lines
923 B
JavaScript
"use strict";
|
|
|
|
const webpack = require("webpack");
|
|
const path = require("path");
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
|
|
module.exports = {
|
|
watch: true,
|
|
mode: "development",
|
|
entry: {
|
|
main: "./test/index.jsx"
|
|
},
|
|
output: {
|
|
publicPath: "/",
|
|
path: path.join(__dirname, "test/"),
|
|
filename: "bundle.js"
|
|
},
|
|
module: {
|
|
rules: [{
|
|
test: /\.jsx?$/,
|
|
exclude: /node_modules/,
|
|
resolve: {
|
|
extensions: [".js", ".jsx"]
|
|
},
|
|
use: [{
|
|
loader: require.resolve("babel-loader")
|
|
}]
|
|
}, {
|
|
test: /\.css$/,
|
|
use: [{
|
|
loader: MiniCssExtractPlugin.loader
|
|
}, {
|
|
loader: require.resolve("css-loader"),
|
|
options: {
|
|
modules: {
|
|
localIdentName: "[name]__[local]--[hash:base64:8]"
|
|
},
|
|
sourceMap: true,
|
|
}
|
|
}]
|
|
}]
|
|
},
|
|
plugins: [
|
|
new MiniCssExtractPlugin({
|
|
filename: "bundle.css",
|
|
chunkFilename: "[id].css"
|
|
})
|
|
],
|
|
devtool: "source-map"
|
|
};
|