Optimize build
This commit is contained in:
parent
935d3796b0
commit
dfaaa08433
3 changed files with 8 additions and 27 deletions
|
|
@ -2,16 +2,16 @@
|
|||
"name": "sdf-2d",
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"clean": "shx rm -rf _bundles lib lib-esm",
|
||||
"start": "shx rm -rf lib/* && webpack --watch",
|
||||
"build": "npm run clean && tsc && tsc -m es6 --outDir lib-esm && webpack"
|
||||
"build": "shx rm -rf lib/* && webpack --production"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "András Schmelczer",
|
||||
"browserslist": [
|
||||
"defaults"
|
||||
],
|
||||
"main": "lib/sdf-2d.js",
|
||||
"main": "lib/main.js",
|
||||
"sideEffects": false,
|
||||
"types": "lib/src/main.d.ts",
|
||||
"files": [
|
||||
"lib"
|
||||
|
|
@ -19,7 +19,6 @@
|
|||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^3.10.1",
|
||||
"@typescript-eslint/parser": "^3.10.1",
|
||||
"awesome-typescript-loader": "^5.2.1",
|
||||
"eslint": "^7.9.0",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-plugin-import": "^2.22.0",
|
||||
|
|
@ -28,7 +27,6 @@
|
|||
"gl-matrix": "^3.3.0",
|
||||
"prettier": "^2.1.2",
|
||||
"raw-loader": "^4.0.1",
|
||||
"resolve-url-loader": "^3.1.1",
|
||||
"shx": "^0.3.2",
|
||||
"terser-webpack-plugin": "^2.3.8",
|
||||
"ts-loader": "^8.0.3",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"compilerOptions": {
|
||||
"outDir": "lib",
|
||||
"sourceMap": true,
|
||||
"noImplicitAny": false,
|
||||
"target": "es5",
|
||||
"downlevelIteration": true,
|
||||
"allowJs": true,
|
||||
|
|
@ -10,7 +9,7 @@
|
|||
"strict": true,
|
||||
"experimentalDecorators": true,
|
||||
"moduleResolution": "Node",
|
||||
"module": "commonjs",
|
||||
"module": "es6",
|
||||
"declaration": true,
|
||||
"composite": true,
|
||||
"declarationMap": true,
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ const isDevelopment = !isProduction;
|
|||
|
||||
module.exports = {
|
||||
entry: {
|
||||
'sdf-2d': [PATHS.entryPoint],
|
||||
'sdf-2d.min': [PATHS.entryPoint],
|
||||
main: [PATHS.entryPoint],
|
||||
},
|
||||
target: 'web',
|
||||
output: {
|
||||
path: PATHS.bundles,
|
||||
filename: '[name].js',
|
||||
|
|
@ -31,26 +31,10 @@ module.exports = {
|
|||
},
|
||||
optimization: {
|
||||
minimize: true,
|
||||
usedExports: true,
|
||||
minimizer: [
|
||||
new TerserJSPlugin({
|
||||
sourceMap: isDevelopment,
|
||||
cache: true,
|
||||
test: /\.ts$/i,
|
||||
terserOptions: {
|
||||
ecma: 5,
|
||||
warnings: true,
|
||||
parse: {},
|
||||
compress: { defaults: true },
|
||||
mangle: true,
|
||||
module: false,
|
||||
output: null,
|
||||
toplevel: true,
|
||||
nameCache: null,
|
||||
ie8: false,
|
||||
keep_classnames: false,
|
||||
keep_fnames: false,
|
||||
safari10: false,
|
||||
},
|
||||
test: /\.js$/i,
|
||||
}),
|
||||
],
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue