File tree Expand file tree Collapse file tree 8 files changed +32
-29
lines changed Expand file tree Collapse file tree 8 files changed +32
-29
lines changed Original file line number Diff line number Diff line change 1
1
/node_modules
2
2
/dist
3
3
/coverage
4
+ /babel.config.cjs
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ presets : [
3
+ [ '@babel/preset-env' , {
4
+ targets : {
5
+ ie : '8'
6
+ }
7
+ } ]
8
+ ]
9
+ }
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ presets : [
3
+ [ '@babel/preset-env' , {
4
+ targets : {
5
+ node : '15.4.0'
6
+ }
7
+ } ]
8
+ ]
9
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2
2
< head >
3
3
< script src ="../dist/modern-async.umd.js "> </ script >
4
4
< script >
5
- console . log ( unknown )
6
- /*
7
- window.modernAsync.asyncRoot(async () => {
5
+ modernAsync . asyncRoot ( async ( ) => {
6
+ await modernAsync . delay ( )
8
7
console . log ( 'hello' )
9
- })*/
8
+ } )
10
9
</ script >
11
10
</ head >
12
11
</ html >
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ module.exports = {
172
172
// A map from regular expressions to paths to transformers
173
173
// transform: {},
174
174
transform : {
175
- '\\.mjs' : 'babel-jest'
175
+ '\\.mjs' : [ 'babel-jest' , { } ]
176
176
} ,
177
177
178
178
// An array of regexp pattern strings that are matched against all source file paths, matched files will
Original file line number Diff line number Diff line change 11
11
},
12
12
"browser" : " ./src/dist/modern-async.umd.js" ,
13
13
"scripts" : {
14
- "build" : " rollup -c rollup.config.js" ,
14
+ "build" : " npm run set-babel-browser && rollup -c rollup.config.js" ,
15
15
"test" : " npm run lint && npm run coverage" ,
16
16
"coverage" : " npm run jest-node -- --coverage" ,
17
17
"lint" : " eslint -c .eslintrc.cjs \" src/**/*.mjs\" " ,
18
- "jest-node" : " jest --config=./jest-node.config.cjs" ,
18
+ "jest-node" : " npm run set-babel-node && jest --config=./jest-node.config.cjs" ,
19
19
"docs" : " jsdoc -c .jsdoc.json && node dev/docs-collect-version-numbers.cjs" ,
20
- "babel" : " babel --ignore \" **/*.test.js\" --out-dir dist/babel --config-file ./babel.config.js src"
20
+ "babel" : " babel --ignore \" **/*.test.js\" --out-dir dist/babel --config-file ./babel.config.js src" ,
21
+ "set-babel-node" : " cp babel-node.config.cjs babel.config.cjs" ,
22
+ "set-babel-browser" : " cp babel-browser.config.cjs babel.config.cjs"
21
23
},
22
24
"repository" : {
23
25
"type" : " git" ,
Original file line number Diff line number Diff line change 1
1
2
2
import { nodeResolve } from '@rollup/plugin-node-resolve'
3
3
import commonjs from '@rollup/plugin-commonjs'
4
- import { getBabelOutputPlugin } from '@rollup/plugin-babel'
4
+ import babel from '@rollup/plugin-babel'
5
5
6
6
export default [ {
7
7
input : 'src/modern-async.mjs' ,
@@ -14,26 +14,12 @@ export default [{
14
14
input : 'src/modern-async-umd.mjs' ,
15
15
output : {
16
16
file : 'dist/modern-async.umd.js' ,
17
- format : 'esm'
17
+ format : 'umd' ,
18
+ name : 'modernAsync'
18
19
} ,
19
20
plugins : [
20
21
nodeResolve ( ) ,
21
22
commonjs ( ) ,
22
- getBabelOutputPlugin ( {
23
- presets : [
24
- [ '@babel/preset-env' , {
25
- targets : {
26
- ie : '8'
27
- }
28
- } ]
29
- ] ,
30
- plugins : [
31
- [ '@babel/plugin-transform-modules-umd' , {
32
- globals : {
33
- unknown : 'modernAsync'
34
- }
35
- } ]
36
- ]
37
- } )
23
+ babel ( { babelHelpers : 'bundled' } )
38
24
]
39
25
} ]
You can’t perform that action at this time.
0 commit comments