-
-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: correct esm configuration for loadable/server, fixes: #999 * chore: put common-js override in * update snapshots
- Loading branch information
Showing
11 changed files
with
98 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"dist/cjs/loadable-server.cjs.js": { | ||
"bundled": 18664, | ||
"minified": 10144, | ||
"gzipped": 2837 | ||
}, | ||
"dist/esm/loadable-server.esm.mjs": { | ||
"bundled": 18299, | ||
"minified": 9859, | ||
"gzipped": 2766, | ||
"treeshaked": { | ||
"rollup": { | ||
"code": 279, | ||
"import_statements": 235 | ||
}, | ||
"webpack": { | ||
"code": 13218 | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import nodeResolve from 'rollup-plugin-node-resolve' | ||
import babel from 'rollup-plugin-babel' | ||
import replace from 'rollup-plugin-replace' | ||
import commonjs from 'rollup-plugin-commonjs' | ||
import { terser } from 'rollup-plugin-terser' | ||
import { sizeSnapshot } from 'rollup-plugin-size-snapshot' | ||
import pkg from './package.json' | ||
|
||
const input = 'src/index.js' | ||
const name = 'loadable' | ||
const globals = { | ||
react: 'React', | ||
'hoist-non-react-statics': 'hoistNonReactStatics', | ||
} | ||
|
||
const external = id => !id.startsWith('.') && !id.startsWith('/') | ||
|
||
const getBabelOptions = ({ useESModules }) => ({ | ||
exclude: '**/node_modules/**', | ||
runtimeHelpers: true, | ||
presets: [ | ||
['@babel/preset-env', { loose: true }], | ||
['@babel/preset-react', { useBuiltIns: true }], | ||
], | ||
plugins: [ | ||
'@babel/plugin-proposal-class-properties', | ||
'babel-plugin-annotate-pure-calls', | ||
['@babel/plugin-transform-runtime', { useESModules }], | ||
], | ||
}) | ||
|
||
export default [ | ||
// cjs | ||
{ | ||
input, | ||
output: { file: pkg.main, format: 'cjs', exports: 'named' }, | ||
external, | ||
plugins: [babel(getBabelOptions({ useESModules: false })), sizeSnapshot()], | ||
}, | ||
// esm | ||
{ | ||
input, | ||
output: { file: pkg.module, format: 'esm' }, | ||
external, | ||
plugins: [babel(getBabelOptions({ useESModules: true })), sizeSnapshot()], | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export { default as ChunkExtractorManager } from './ChunkExtractorManager.js' | ||
export { default as ChunkExtractor } from './ChunkExtractor.js' | ||
export { default as ChunkExtractorManager } from './ChunkExtractorManager' | ||
export { default as ChunkExtractor } from './ChunkExtractor' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters