Skip to content

Commit 09e23a8

Browse files
committed
Fix rollup build bug
1 parent ace4fc0 commit 09e23a8

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"react-dom": "^16.8.6",
4747
"rollup": "^1.10.0",
4848
"rollup-plugin-babel": "^4.3.2",
49+
"rollup-plugin-commonjs": "^9.3.4",
4950
"rollup-plugin-node-resolve": "^4.2.3",
5051
"rollup-plugin-postcss": "^2.0.3",
5152
"rollup-plugin-replace": "^2.2.0",

rollup.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import resolve from 'rollup-plugin-node-resolve';
2+
import commonjs from 'rollup-plugin-commonjs';
23
import babel from 'rollup-plugin-babel';
34
import replace from 'rollup-plugin-replace';
45
import postcss from 'rollup-plugin-postcss';
@@ -8,14 +9,14 @@ import pkg from './package.json';
89

910
export default {
1011
input: './src/IFramePlayground.jsx',
11-
output: { file: 'dist/IFramePlayground.min.js', format: 'esm' },
12+
output: { file: './dist/IFramePlayground.min.js', format: 'esm' },
1213
plugins: [
1314
replace({
1415
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
1516
}),
1617
resolve(),
18+
commonjs(),
1719
babel({
18-
exclude: 'node_modules/**',
1920
presets: [
2021
'@babel/preset-react',
2122
['@babel/preset-env', { modules: false }],
@@ -25,7 +26,7 @@ export default {
2526
}),
2627
terser(),
2728
postcss({
28-
extract: true,
29+
modules: true,
2930
}),
3031
],
3132
external: Object.keys(pkg.peerDependencies),

yarn.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9792,6 +9792,16 @@ rollup-plugin-babel@^4.3.2:
97929792
"@babel/helper-module-imports" "^7.0.0"
97939793
rollup-pluginutils "^2.3.0"
97949794

9795+
rollup-plugin-commonjs@^9.3.4:
9796+
version "9.3.4"
9797+
resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.3.4.tgz#2b3dddbbbded83d45c36ff101cdd29e924fd23bc"
9798+
integrity sha512-DTZOvRoiVIHHLFBCL4pFxOaJt8pagxsVldEXBOn6wl3/V21wVaj17HFfyzTsQUuou3sZL3lEJZVWKPFblJfI6w==
9799+
dependencies:
9800+
estree-walker "^0.6.0"
9801+
magic-string "^0.25.2"
9802+
resolve "^1.10.0"
9803+
rollup-pluginutils "^2.6.0"
9804+
97959805
rollup-plugin-node-resolve@^4.2.3:
97969806
version "4.2.3"
97979807
resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.2.3.tgz#638a373a54287d19fcc088fdd1c6fd8a58e4d90a"

0 commit comments

Comments
 (0)