-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for rollup bundles
BREAKING CHANGE: This is a change in the use of bundled resources, removed depenbdency on polyfill file and created ES5 and ES6 resources
- Loading branch information
1 parent
c0677e9
commit 948c0fe
Showing
8 changed files
with
923 additions
and
5,108 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
const { browserslist: defaultBrowserslist } = require('./package.json'); | ||
|
||
const modernBrowserslist = defaultBrowserslist.filter( | ||
(browser) => browser !== 'ie 11' | ||
); | ||
|
||
const sharedPlugins = [ | ||
'@babel/plugin-syntax-dynamic-import', | ||
[ | ||
'@babel/plugin-transform-runtime', | ||
{ | ||
useESModules: true | ||
} | ||
] | ||
]; | ||
|
||
module.exports = { | ||
exclude: [ | ||
'node_modules/@babel/**', | ||
'node_modules/core-js/**', | ||
'node_modules/@webcomponents/webcomponentsjs/**' | ||
], | ||
env: { | ||
modern: { | ||
// lit-element supports the last two versions of modern browsers, so we don't need to polyfill | ||
exclude: ['node_modules/lit-element/**', 'node_modules/lit-html/**'], | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: modernBrowserslist.join(', '), | ||
useBuiltIns: 'usage', | ||
corejs: 3 | ||
} | ||
] | ||
], | ||
plugins: sharedPlugins | ||
}, | ||
legacy: { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: defaultBrowserslist.join(', '), | ||
useBuiltIns: 'usage', | ||
corejs: 3 | ||
} | ||
] | ||
], | ||
plugins: sharedPlugins | ||
} | ||
} | ||
}; |
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
Oops, something went wrong.