代码拉取完成,页面将自动刷新
/**
* Main file of webpack config for RTL.
* Please do not modified unless you know what to do
*/
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const WebpackRTLPlugin = require("webpack-rtl-plugin");
const WebpackMessages = require("webpack-messages");
const del = require("del");
// theme name
const themeName = "metronic";
// global variables
const rootPath = path.resolve(__dirname);
const distPath = rootPath + "/src/assets";
const entries = {
"css/style.vue": "./src/assets/sass/style.vue.scss"
};
// remove older folders and files
(async () => {
await del.sync(distPath + "/css", { force: true });
})();
const mainConfig = function() {
return {
mode: "development",
stats: "errors-only",
performance: {
hints: false
},
entry: entries,
output: {
// main output path in assets folder
path: distPath,
// output path based on the entries' filename
filename: "[name].js"
},
resolve: { extensions: [".scss"] },
plugins: [
// webpack log message
new WebpackMessages({
name: themeName,
logger: str => console.log(`>> ${str}`)
}),
// create css file
new MiniCssExtractPlugin({
filename: "[name].css"
}),
new WebpackRTLPlugin({
filename: "[name].rtl.css"
}),
{
apply: compiler => {
// hook name
compiler.hooks.afterEmit.tap("AfterEmitPlugin", () => {
(async () => {
await del.sync(distPath + "/css/*.js", { force: true });
})();
});
}
}
],
module: {
rules: [
{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
{
loader: "sass-loader",
options: {
sourceMap: true
}
}
]
}
]
}
};
};
module.exports = function() {
return [mainConfig()];
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。