123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- const VueLoaderPlugin = require('vue-loader/lib/plugin');
- // const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
- module.exports = {
- module: {
- rules: [
- {
- test: /\.vue$/,
- loader: 'vue-loader',
- options: {
- loaders: {
- scss: 'style-loader!css-loader!sass-loader'
- },
- },
- },
- {
- test: /\.css$/,
- use:[
- {
- loader: MiniCssExtractPlugin.loader,
- options: {
- hmr: process.env.NODE_ENV === 'development',
- },
- },
- 'css-loader',
- ]
- },
- {
- test: /\.js$/,
- exclude: /node_modules/,
- use: {
- loader: 'babel-loader',
- options: {
- presets: [
- ['@babel/preset-env']
- ]
- }
- }
- },
- {
- test: /\.(png|jpg|gif|svg|woff|ttf)$/,
- loader: 'file-loader',
- options: {
- name: '[name].[ext]?[hash]'
- }
- }
- ]
- },
- plugins: [
- new MiniCssExtractPlugin({
- // Options similar to the same options in webpackOptions.output
- // all options are optional
- filename: '[name]/main.css',
- ignoreOrder: false, // Enable to remove warnings about conflicting order
- }),
- new VueLoaderPlugin(),
- // new BundleAnalyzerPlugin(),
- ]
- };
|