因此,我正在尝试设置此应用程序,以便可以开始对其进行编码。但每次我构建应用程序时;webpack 会自动添加auto/file.js到 script 标签,但它实际上应该是:file.js。所以它auto/自己添加了该部分。我已经检查了每个 webpack 配置文件,但我无法理解为什么它会auto/在我的脚本中添加前缀。
还要提一下这是一个 ElectronJS 项目。这是我的 webpack 配置。
webpack.config.js
const mainConfig = require("./webpack.main.config");
const rendererConfig = require("./webpack.renderer.config");
const config = [mainConfig, rendererConfig];
module.exports = config;
webpack.base.config.js
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const config = {
plugins: [
new UglifyJsPlugin({
test: /\.js($|\?)/i,
sourceMap: true,
uglifyOptions: {
compress: true
}
})
]
};
module.exports = config;
webpack.main.config.js const path = require("path"); const merge = require("webpack-merge");
const base = require("./webpack.base.config");
const buildPath = path.resolve(__dirname, "./dist");
const main = merge(base, {
entry: "./main.js",
output: {
filename: "main.js",
path: buildPath
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: "babel-loader"
},
]
},
node: {
__dirname: false,
__filename: false
},
target: "electron-main"
});
module.exports = main;
守着一只汪
相关分类