mirror of
https://github.com/wassname/talk.git
synced 2026-08-03 13:20:59 +08:00
Added configuration for the babel polyfill
This commit is contained in:
@@ -45,6 +45,7 @@ These are only used during the webpack build.
|
||||
thread. (Default `3`)
|
||||
- `TALK_DEFAULT_STREAM_TAB` (_optional_) - specify the default stream tab in the
|
||||
admin. (Default `all`)
|
||||
- `TALK_DISABLE_EMBED_POLYFILL` (_optional_) - when set to `TRUE`, the build process will not include the [babel-polyfill](https://babeljs.io/docs/usage/polyfill/) in the embed.js target. (Default `FALSE`)
|
||||
|
||||
### Database
|
||||
|
||||
|
||||
+13
-7
@@ -154,8 +154,16 @@ if (process.env.NODE_ENV === 'production') {
|
||||
|
||||
// Applies the base configuration to the following entries.
|
||||
const applyConfig = (entries, root = {}) => _.merge({}, config, {
|
||||
entry: entries.reduce((entry, {name, path}) => {
|
||||
entry[name] = path;
|
||||
entry: entries.reduce((entry, {name, path, disablePolyfill = false}) => {
|
||||
if (disablePolyfill) {
|
||||
entry[name] = path;
|
||||
} else {
|
||||
entry[name] = [
|
||||
'babel-polyfill',
|
||||
path
|
||||
];
|
||||
}
|
||||
|
||||
return entry;
|
||||
}, {})
|
||||
}, root);
|
||||
@@ -168,7 +176,8 @@ module.exports = [
|
||||
// Load in the root embed.
|
||||
{
|
||||
name: 'embed',
|
||||
path: path.join(__dirname, 'client/coral-embed/src/index')
|
||||
path: path.join(__dirname, 'client/coral-embed/src/index'),
|
||||
disablePolyfill: process.env.TALK_DISABLE_EMBED_POLYFILL === 'TRUE'
|
||||
}
|
||||
|
||||
], {
|
||||
@@ -189,10 +198,7 @@ module.exports = [
|
||||
// Load in all the embeds.
|
||||
...buildEmbeds.map((embed) => ({
|
||||
name: `embed/${embed}/bundle`,
|
||||
path: [
|
||||
'babel-polyfill',
|
||||
path.join(__dirname, 'client/', `coral-embed-${embed}`, '/src/index')
|
||||
]
|
||||
path: path.join(__dirname, 'client/', `coral-embed-${embed}`, '/src/index')
|
||||
})),
|
||||
|
||||
// Load in all the plugin entries.
|
||||
|
||||
Reference in New Issue
Block a user