45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
const path = require("path");
|
|
const CopyPlugin = require("copy-webpack-plugin");
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
|
|
module.exports = {
|
|
entry: './src/index.jsx',
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: 'index.js'
|
|
},
|
|
target: 'web',
|
|
devtool: 'eval-cheap-source-map',
|
|
resolve: {
|
|
extensions: [".js", ".jsx"]
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.jsx?$/,
|
|
exclude: /node_modules/,
|
|
loader: "babel-loader",
|
|
options: {
|
|
plugins: [
|
|
"@babel/transform-react-jsx",
|
|
"@babel/proposal-object-rest-spread",
|
|
"@babel/plugin-syntax-class-properties",
|
|
]
|
|
}
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: [MiniCssExtractPlugin.loader, "css-loader", "postcss-loader"]
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new MiniCssExtractPlugin({ filename: 'styles/panel.css' }),
|
|
new CopyPlugin([
|
|
'cep'
|
|
], {
|
|
copyUnmodified: true
|
|
})
|
|
]
|
|
};
|