Babel 7 not transpiling vendor chunk
up vote
0
down vote
favorite
Some of the modules used by other imported libraries are using const instead of var and generated vendors chunk contains const which throws error on older browsers
SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.
my babel config
presets: [
[
'@babel/preset-env',
{
modules: false,
},
],
'@babel/preset-react',
],
plugins: [
'@babel/plugin-transform-runtime',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-dynamic-import',
],
env: {
production: {
only: ['app', 'ssr'],
plugins: [
'react-loadable/babel',
'lodash',
'transform-react-remove-prop-types',
'@babel/plugin-transform-react-inline-elements',
'@babel/plugin-transform-react-constant-elements',
],
},
test: {
plugins: [
'@babel/plugin-transform-modules-commonjs',
'dynamic-import-node',
],
},
},
and webpack rule
{
test: /.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: Object.assign({
sourceType: 'unambiguous',
}),
},
},
webpack babel
add a comment |
up vote
0
down vote
favorite
Some of the modules used by other imported libraries are using const instead of var and generated vendors chunk contains const which throws error on older browsers
SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.
my babel config
presets: [
[
'@babel/preset-env',
{
modules: false,
},
],
'@babel/preset-react',
],
plugins: [
'@babel/plugin-transform-runtime',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-dynamic-import',
],
env: {
production: {
only: ['app', 'ssr'],
plugins: [
'react-loadable/babel',
'lodash',
'transform-react-remove-prop-types',
'@babel/plugin-transform-react-inline-elements',
'@babel/plugin-transform-react-constant-elements',
],
},
test: {
plugins: [
'@babel/plugin-transform-modules-commonjs',
'dynamic-import-node',
],
},
},
and webpack rule
{
test: /.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: Object.assign({
sourceType: 'unambiguous',
}),
},
},
webpack babel
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Some of the modules used by other imported libraries are using const instead of var and generated vendors chunk contains const which throws error on older browsers
SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.
my babel config
presets: [
[
'@babel/preset-env',
{
modules: false,
},
],
'@babel/preset-react',
],
plugins: [
'@babel/plugin-transform-runtime',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-dynamic-import',
],
env: {
production: {
only: ['app', 'ssr'],
plugins: [
'react-loadable/babel',
'lodash',
'transform-react-remove-prop-types',
'@babel/plugin-transform-react-inline-elements',
'@babel/plugin-transform-react-constant-elements',
],
},
test: {
plugins: [
'@babel/plugin-transform-modules-commonjs',
'dynamic-import-node',
],
},
},
and webpack rule
{
test: /.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: Object.assign({
sourceType: 'unambiguous',
}),
},
},
webpack babel
Some of the modules used by other imported libraries are using const instead of var and generated vendors chunk contains const which throws error on older browsers
SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.
my babel config
presets: [
[
'@babel/preset-env',
{
modules: false,
},
],
'@babel/preset-react',
],
plugins: [
'@babel/plugin-transform-runtime',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-dynamic-import',
],
env: {
production: {
only: ['app', 'ssr'],
plugins: [
'react-loadable/babel',
'lodash',
'transform-react-remove-prop-types',
'@babel/plugin-transform-react-inline-elements',
'@babel/plugin-transform-react-constant-elements',
],
},
test: {
plugins: [
'@babel/plugin-transform-modules-commonjs',
'dynamic-import-node',
],
},
},
and webpack rule
{
test: /.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: Object.assign({
sourceType: 'unambiguous',
}),
},
},
webpack babel
webpack babel
asked Nov 8 at 17:53
ewief
114
114
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53213509%2fbabel-7-not-transpiling-vendor-chunk%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown