File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 7
7
"commit-amend-build" : " scripts/commit-amend-build.sh" ,
8
8
"prebuild" : " rimraf dist/**" ,
9
9
"dev" : " cross-env NODE_ENV=development BABEL_ENV=rollup rollup -w -c -o dist/purify.js" ,
10
- "build" : " rollup -c" ,
10
+ "build" : " cross-env NODE_ENV=production rollup -c" ,
11
+ "build:umd" : " rollup -c -f umd -o dist/purify.js" ,
12
+ "build:umd:min" : " rollup -c -f umd -o dist/purify.min.js -p terser" ,
13
+ "build:es" : " rollup -c -f es -o dist/purify.es.js" ,
14
+ "build:cjs" : " rollup -c -f cjs -o dist/purify.cjs.js" ,
11
15
"test:jsdom" : " cross-env NODE_ENV=test BABEL_ENV=rollup node test/jsdom-node-runner --dot" ,
12
16
"test:karma" : " cross-env NODE_ENV=test BABEL_ENV=rollup karma start test/karma.conf.js --log-level warn " ,
13
17
"test:ci" : " cross-env NODE_ENV=test BABEL_ENV=rollup npm run test:jsdom && npm run test:karma -- --log-level error --reporters dots --single-run --shouldTestOnBrowserStack=\" ${TEST_BROWSERSTACK}\" --shouldProbeOnly=\" ${TEST_PROBE_ONLY}\" " ,
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const { terser } = require('rollup-plugin-terser');
6
6
const pkg = require ( './package.json' ) ;
7
7
8
8
const env = process . env . NODE_ENV ;
9
+ const isProd = env === 'production' ;
9
10
const version = process . env . npm_package_version ;
10
11
const license = fs
11
12
. readFileSync ( './src/license_header' , 'utf8' )
@@ -31,7 +32,7 @@ const config = {
31
32
...commonOutputConfig ,
32
33
file : pkg . production ,
33
34
format : 'umd' ,
34
- plugins : [ terser ( ) ] ,
35
+ plugins : isProd ? [ terser ( ) ] : [ ] ,
35
36
} ,
36
37
{
37
38
...commonOutputConfig ,
You can’t perform that action at this time.
0 commit comments