File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
2+ "root": true,
23 "env": {
34 "browser": true,
45 "commonjs": true,
Original file line number Diff line number Diff line change 2222 node-version : 18
2323 - run : npm ci
2424 - run : npm run build
25- - run : npm run prod
2625 - name : Archive production artifacts
2726 uses : actions/upload-artifact@v2
2827 with :
Original file line number Diff line number Diff line change 2121 node-version : 18
2222 - run : npm ci
2323 - run : npm run build
24- - run : npm run prod
2524
2625 publish-npm :
2726 needs : build
3433 registry-url : https://registry.npmjs.org/
3534 - run : npm ci
3635 - run : npm run build
37- - run : npm run prod
3836 - run : npm publish
3937 env :
4038 NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
5048 registry-url : https://registry.npmjs.org/
5149 - run : npm ci
5250 - run : npm run build
53- - run : npm run prod
5451 - uses : softprops/action-gh-release@v1
5552 if : startsWith(github.ref, 'refs/tags/')
5653 with :
Original file line number Diff line number Diff line change 11import chalk from 'chalk'
22
33// Rollup plugins
4- import { eslint } from 'rollup-plugin-eslint'
5- import { terser } from 'rollup-plugin-terser'
6- import buble from '@rollup/plugin-buble'
7- import replace from '@rollup/plugin-replace'
4+ import eslint from '@rollup/plugin-eslint'
85import resolve from '@rollup/plugin-node-resolve'
96import commonjs from '@rollup/plugin-commonjs'
7+ import esbuild from 'rollup-plugin-esbuild'
108import progress from 'rollup-plugin-progress'
119
12- switch ( process . env . BUILD_ENV ) {
13- case 'DEV' : {
14- console . log ( chalk . cyan ( '+--------------=+| DEVELOP BUILD |+=--------------+' ) )
15- break
16- }
17- case 'CI' : {
18- console . log ( chalk . green ( '+--------------=+| CI BUILD |+=--------------+' ) )
19- break
20- }
21- default : {
22- console . log ( chalk . yellow ( '+--------------=+| NORMAL BUILD |+=--------------+' ) )
23- }
24- }
10+ const isProduction = process . env . NODE_ENV === 'production'
2511
2612// Log build environment
2713console . log ( 'Build Target:' , chalk . bold . green ( process . env . BUILD_TARGET || 'development' ) )
@@ -47,19 +33,10 @@ export default {
4733 browser : true ,
4834 } ) ,
4935 commonjs ( ) ,
50- replace ( {
51- preventAssignment : true ,
52- values : {
53- 'process.env.NODE_ENV' : `'${ process . env . BUILD_TARGET || 'development' } '`
54- }
55- } ) ,
56- buble ( {
57- transforms : {
58- modules : false ,
59- dangerousForOf : true
60- } ,
61- objectAssign : 'Object.assign'
62- } ) ,
63- ( process . env . BUILD_TARGET === 'production' && terser ( ) )
36+ esbuild ( {
37+ target : 'es2015' ,
38+ sourceMap : true ,
39+ minify : isProduction
40+ } )
6441 ]
6542}
Original file line number Diff line number Diff line change 11// Import base config
22import base from './rollup.base.mjs'
33
4- if ( process . env . BUILD_TARGET === 'production' ) base . output . file = `${ base . proPath } /${ base . bundle } .min.js`
5- else base . output . file = `${ base . proPath } /${ base . bundle } .dev.js`
6-
7- base . output . sourcemap = process . env . BUILD_ENV === 'DEMO' || process . env . BUILD_ENV === 'CI' ? base . output . sourcemap : false
4+ base . output . file = `${ base . proPath } /${ base . bundle } .min.js`
85
96delete base . bundle
107delete base . devPath
You can’t perform that action at this time.
0 commit comments