1 Star 0 Fork 53

dou dou / thingspanel-vue

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webpack-rtl.config.js 2.24 KB
一键复制 编辑 原始数据 按行查看 历史
/**
* 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");
const webpack = require("webpack");
// theme name
const themeName = "thingspanel";
// 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"
},
watchOptions: false,
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"
}),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
{
apply: compiler => {
// hook name
compiler.hooks.afterEmit.tap("AfterEmitPlugin", () => {
(async () => {
await del.sync(distPath + "/css/*.js", { force: true });
})();
});
}
},
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
],
module: {
rules: [
...(config.dev.useEslint ? [] : []),
{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
{
loader: "sass-loader",
options: {
sourceMap: true
}
}
]
}
]
}
};
};
module.exports = function() {
return [mainConfig()];
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hugosz/thingspanel-vue.git
git@gitee.com:hugosz/thingspanel-vue.git
hugosz
thingspanel-vue
thingspanel-vue
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891