From d5dc48043b61c52695ffa5a3a43a51c0d5084a13 Mon Sep 17 00:00:00 2001 From: Victory Osayi Date: Sun, 21 Mar 2021 04:49:27 +0100 Subject: [PATCH] Removed sourcemap from build bundle files. --- package.json | 4 ++-- rollup.config.js | 20 ++++++++++---------- tsconfig.json | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 1591916..db7f21c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-simple-acl", - "version": "1.0.4", + "version": "1.0.5", "description": "A simple unopinionated Vue plugin for managing user roles and permissions, access-control list (ACL) and role-based access control (RBAC).", "main": "dist/vue-simple-acl.js", "browser": "dist/vue-simple-acl.min.js", @@ -13,7 +13,7 @@ ], "scripts": { "dev": "vite", - "build": "npm run build:package", + "build": "NODE_ENV=production npm run build:package", "build:vite": "vuedx-typecheck . && vite build", "serve": "vite preview", "build:package": "rollup --config rollup.config.js", diff --git a/rollup.config.js b/rollup.config.js index ac12ac1..12138c6 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -21,7 +21,7 @@ export default [ name: 'VueSimpleAcl', file: "dist/vue-simple-acl.js", format: "umd", - sourcemap: true, + sourcemap: (process.env.NODE_ENV === 'production' ? false : 'inline'), globals: { vue: 'Vue' } @@ -30,7 +30,7 @@ export default [ name: 'VueSimpleAcl', file: "dist/vue-simple-acl.esm.js", format: "es", - sourcemap: true, + sourcemap: (process.env.NODE_ENV === 'production' ? false : 'inline'), globals: { vue: 'Vue' } @@ -39,7 +39,7 @@ export default [ name: 'VueSimpleAcl', file: "dist/vue-simple-acl.cjs.js", format: "cjs", - sourcemap: true, + sourcemap: (process.env.NODE_ENV === 'production' ? false : 'inline'), globals: { vue: 'Vue' } @@ -48,7 +48,7 @@ export default [ name: 'VueSimpleAcl', file: "dist/vue-simple-acl.min.js", format: "iife", - sourcemap: true, + sourcemap: (process.env.NODE_ENV === 'production' ? false : 'inline'), globals: { vue: 'Vue' } @@ -62,7 +62,7 @@ export default [ css(), // auto(), resolve({ browser: true}), - // terser(), + (process.env.NODE_ENV === 'production' && terser()), // terser() typescript({ exclude: ['node_modules/**', 'playground/**'] // use lib: and target: config in tsconfig.json @@ -88,7 +88,7 @@ export default [ name: 'VueSimpleAcl', file: "dist/vue-simple-acl.vue2.js", format: "umd", - sourcemap: true, + sourcemap: (process.env.NODE_ENV === 'production' ? false : 'inline'), globals: { vue: 'Vue' } @@ -97,7 +97,7 @@ export default [ name: 'VueSimpleAcl', file: "dist/vue-simple-acl.vue2.esm.js", format: "es", - sourcemap: true, + sourcemap: (process.env.NODE_ENV === 'production' ? false : 'inline'), globals: { vue: 'Vue' } @@ -106,7 +106,7 @@ export default [ name: 'VueSimpleAcl', file: "dist/vue-simple-acl.vue2.cjs.js", format: "cjs", - sourcemap: true, + sourcemap: (process.env.NODE_ENV === 'production' ? false : 'inline'), globals: { vue: 'Vue' } @@ -115,7 +115,7 @@ export default [ name: 'VueSimpleAcl', file: "dist/vue-simple-acl.vue2.min.js", format: "iife", - sourcemap: true, + sourcemap: (process.env.NODE_ENV === 'production' ? false : 'inline'), globals: { vue: 'Vue' } @@ -129,7 +129,7 @@ export default [ css(), // auto(), resolve({ browser: true}), - terser(), + (process.env.NODE_ENV === 'production' && terser()), // terser() typescript({ exclude: ['node_modules/**', 'playground/**'] // use lib: and target: config in tsconfig.json diff --git a/tsconfig.json b/tsconfig.json index 8fb4641..7774d55 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,7 @@ "moduleResolution": "node", "strict": true, "jsx": "preserve", - "sourceMap": true, + "sourceMap": false, // true "resolveJsonModule": true, "esModuleInterop": true, "lib": ["esnext", "dom"],