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

6 years ago
"use strict";
const webpack = require("webpack");
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
watch: true,
mode: "development",
entry: {
5 years ago
main: "./test/index.jsx"
6 years ago
},
output: {
publicPath: "/",
5 years ago
path: path.join(__dirname, "test/"),
6 years ago
filename: "bundle.js"
},
module: {
rules: [{
test: /\.jsx?$/,
exclude: /node_modules/,
resolve: {
extensions: [".js", ".jsx"]
},
use: [{
5 years ago
loader: require.resolve("babel-loader")
6 years ago
}]
}, {
test: /\.css$/,
use: [{
loader: MiniCssExtractPlugin.loader
}, {
loader: require.resolve("css-loader"),
options: {
5 years ago
modules: {
localIdentName: "[name]__[local]--[hash:base64:8]"
},
6 years ago
sourceMap: true,
}
}]
}]
},
plugins: [
new MiniCssExtractPlugin({
5 years ago
filename: "bundle.css",
6 years ago
chunkFilename: "[id].css"
5 years ago
})
6 years ago
],
devtool: "source-map"
};