1234567891011121314151617181920212223242526272829303132 |
- const path = require('path');
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
-
- module.exports = {
- entry: "./src/index.js",
- output: {
- path: path.resolve(__dirname, "ext"),
- filename: "index.js",
- },
- mode: "production",
- module: {
- rules: [
- {
- test: /\.css$/,
- use: [
- {
- loader: MiniCssExtractPlugin.loader,
- options: {
- publicPath: (resourcePath, context) => {
- return path.relative(path.dirname(resourcePath), context) + '/';
- },
- },
- },
- 'css-loader',
- ],
- },
- ]
- },
- plugins: [
- new MiniCssExtractPlugin({ filename: 'style.css' }),
- ],
- };
|