代码拉取完成,页面将自动刷新
const Path = require('path');
const Webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const FixStyleOnlyEntriesPlugin = require('webpack-fix-style-only-entries');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: {
'js/index': Path.resolve(__dirname, '../src/js/index.js'),
'css/index': Path.resolve(__dirname, '../src/scss/index.scss'),
},
output: {
path: Path.join(__dirname, '../dist'),
filename: '[name].min.js',
},
plugins: [
new Webpack.ProvidePlugin({
'mdb': 'mdb',
}),
new CopyWebpackPlugin([
{ from: Path.resolve(__dirname, '../src/index.html') },
{ from: Path.resolve(__dirname, '../src/img'), to: 'img' },
]),
new FixStyleOnlyEntriesPlugin(),
new MiniCssExtractPlugin({
filename: '[name].min.css',
}),
],
resolve: {
alias: {
'~': Path.resolve(__dirname, '../src'),
'mdb': Path.join(__dirname, '../node_modules/mdb-ui-kit'),
},
},
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
},
{
test: /\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)(\?.*)?$/,
use: {
loader: 'file-loader',
options: {
name: '[path][name].[ext]',
},
},
},
{
test: /\.s?css/i,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'postcss-loader', 'sass-loader'],
},
],
},
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。