mirror of
https://github.com/projectstorm/react-diagrams.git
synced 2025-08-14 16:51:29 +08:00
more reformatting
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
const production = process.env.NODE_ENV === "production";
|
||||
const production = process.env.NODE_ENV === 'production';
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
const nodeExternals = require('webpack-node-externals');
|
||||
const path = require('path');
|
||||
@ -7,30 +7,30 @@ module.exports = (directory) => {
|
||||
return {
|
||||
entry: path.join(directory, './dist/index.js'),
|
||||
output: {
|
||||
filename: "index.umd.js",
|
||||
filename: 'index.umd.js',
|
||||
path: path.join(directory, 'dist'),
|
||||
libraryTarget: "umd",
|
||||
libraryTarget: 'umd'
|
||||
},
|
||||
externals: [
|
||||
nodeExternals({modulesDir: path.join(directory, 'node_modules')}),
|
||||
nodeExternals({modulesDir: path.join(__dirname, 'node_modules')}),
|
||||
nodeExternals({ modulesDir: path.join(directory, 'node_modules') }),
|
||||
nodeExternals({ modulesDir: path.join(__dirname, 'node_modules') })
|
||||
],
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
enforce: "pre",
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
loader: "source-map-loader"
|
||||
loader: 'source-map-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".tsx", ".ts", ".js"]
|
||||
extensions: ['.tsx', '.ts', '.js']
|
||||
},
|
||||
devtool: production ? "source-map" : "cheap-module-source-map",
|
||||
mode: production ? "production" : "development",
|
||||
devtool: production ? 'source-map' : 'cheap-module-source-map',
|
||||
mode: production ? 'production' : 'development',
|
||||
optimization: {
|
||||
minimizer: [new TerserPlugin()],
|
||||
minimizer: [new TerserPlugin()]
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user