web -> desktop
This commit is contained in:
40
build/webpack.base.config.js
Normal file
40
build/webpack.base.config.js
Normal file
@ -0,0 +1,40 @@
|
||||
const path = require("path");
|
||||
const nodeExternals = require("webpack-node-externals");
|
||||
const FriendlyErrorsWebpackPlugin = require("friendly-errors-webpack-plugin");
|
||||
|
||||
module.exports = env => {
|
||||
return {
|
||||
target: "node",
|
||||
node: {
|
||||
__dirname: false,
|
||||
__filename: false
|
||||
},
|
||||
externals: [nodeExternals()],
|
||||
resolve: {
|
||||
alias: {
|
||||
env: path.resolve(__dirname, `../config/env_${env}.json`)
|
||||
}
|
||||
},
|
||||
devtool: "source-map",
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
use: ["babel-loader"]
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ["style-loader", "css-loader"]
|
||||
},
|
||||
{
|
||||
test: /\.(?:ico|gif|png|jpg|jpeg|webp)$/,
|
||||
use: ['url-loader']
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new FriendlyErrorsWebpackPlugin({ clearConsole: env === "development" })
|
||||
]
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user