Skip to content

Commit

Permalink
rollup config 의 babelHelpers를 runtime으로 변경 (#239)
Browse files Browse the repository at this point in the history
* 명시적으로 babelHelpers 를 추가하여 warning 삭제

* babelHelper 를 runtime으로 변경하고 필요한 옵션 추가

* rollup bundle visualizer를 dev dep으로 추가

* 레오 리뷰 반영

trailing comma
filename to gitignore
  • Loading branch information
quino0627 authored Feb 18, 2021
1 parent 0b7be47 commit 7c5cc2b
Show file tree
Hide file tree
Showing 5 changed files with 202 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,6 @@ storybook-static/

# WebStorm
.idea

# Rollup Plugin Visualizer
stats.html
2 changes: 2 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
['@babel/preset-typescript', { isTSX: true, allExtensions: true }],
],
plugins: [
"@babel/plugin-transform-runtime",
["@babel/plugin-proposal-decorators", { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: false }],
['@babel/plugin-transform-classes', { loose: true }],
Expand All @@ -25,6 +26,7 @@ module.exports = {
['@babel/preset-typescript', { isTSX: true, allExtensions: true }],
],
plugins: [
"@babel/plugin-transform-runtime",
["@babel/plugin-proposal-decorators", { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: false }],
['@babel/plugin-transform-classes', { loose: true }],
Expand Down
212 changes: 188 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-decorators": "^7.12.1",
"@babel/plugin-transform-classes": "^7.12.1",
"@babel/plugin-transform-runtime": "^7.12.15",
"@babel/preset-env": "^7.12.11",
"@babel/preset-react": "^7.12.10",
"@babel/preset-typescript": "^7.12.7",
Expand Down Expand Up @@ -127,6 +128,7 @@
"regenerator-runtime": "^0.13.7",
"rollup": "^2.37.1",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-visualizer": "^4.2.0",
"styled-components": "^5.2.1",
"stylelint": "^13.8.0",
"ts-node": "^8.10.2",
Expand All @@ -138,6 +140,7 @@
"styled-components": ">=5"
},
"dependencies": {
"@babel/runtime": "^7.12.13",
"antlr4": "^4.8.0",
"core-decorators": "^0.20.0",
"lodash-es": "^4.17.15",
Expand Down
6 changes: 6 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import peerDepsExternal from 'rollup-plugin-peer-deps-external'
import resolve from '@rollup/plugin-node-resolve'
import babel from '@rollup/plugin-babel'
import commonjs from '@rollup/plugin-commonjs'
import visualizer from 'rollup-plugin-visualizer'

import packageJson from './package.json'

Expand All @@ -29,8 +30,13 @@ export default {
}),
commonjs(),
babel({
babelHelpers: 'runtime',
exclude: 'node_modules/**',
extensions,
}),
visualizer({
filename: "stats.html",
}),
],
external: [/@babel\/runtime/],
}

0 comments on commit 7c5cc2b

Please sign in to comment.