Move frontend babel configuration to webpack configuration file.
parent
ac951aba32
commit
fc0b06a1be
10
.babelrc
10
.babelrc
|
@ -2,20 +2,14 @@
|
|||
"presets": [
|
||||
["babel-preset-env", {
|
||||
"targets": {
|
||||
"browsers": [
|
||||
"> 1%",
|
||||
"last 4 versions",
|
||||
"Firefox ESR",
|
||||
"ios >= 8"
|
||||
],
|
||||
"node": true,
|
||||
"uglify": false
|
||||
},
|
||||
"spec": true,
|
||||
"debug": true
|
||||
"debug": false
|
||||
}]
|
||||
],
|
||||
"plugins": [
|
||||
"babel-plugin-transform-react-constant-elements",
|
||||
"babel-plugin-transform-class-properties",
|
||||
"babel-plugin-syntax-dynamic-import"
|
||||
]
|
||||
|
|
32
src/.babelrc
32
src/.babelrc
|
@ -1,32 +0,0 @@
|
|||
{
|
||||
"presets": [
|
||||
["babel-preset-env", {
|
||||
"targets": {
|
||||
"browsers": [
|
||||
"> 1%",
|
||||
"last 4 versions",
|
||||
"Firefox ESR",
|
||||
"ios >= 8"
|
||||
],
|
||||
"uglify": false
|
||||
},
|
||||
/*"spec": true,*/
|
||||
"debug": true,
|
||||
"modules": false
|
||||
}],
|
||||
"babel-preset-react"
|
||||
],
|
||||
"plugins": [
|
||||
"react-hot-loader/babel",
|
||||
"babel-plugin-transform-react-constant-elements",
|
||||
/*"babel-plugin-transform-react-remove-prop-types",*/
|
||||
/*"babel-plugin-transform-decorators-legacy",*/
|
||||
"babel-plugin-transform-class-properties",
|
||||
["babel-plugin-transform-runtime", {
|
||||
"helpers": false,
|
||||
"polyfill": false,
|
||||
"regenerator": true
|
||||
}],
|
||||
"babel-plugin-syntax-dynamic-import"
|
||||
]
|
||||
}
|
|
@ -28,6 +28,13 @@ const {
|
|||
|
||||
const locales = ['en'];
|
||||
|
||||
const autoprefixerTargets = [
|
||||
'> 1%',
|
||||
'last 4 versions',
|
||||
'Firefox ESR',
|
||||
'ios >= 8',
|
||||
];
|
||||
|
||||
/**
|
||||
* Plugin for HtmlPlugin which inlines content for an extracted Webpack manifest
|
||||
* into the HTML in a <script> tag before other emitted asssets are injected by
|
||||
|
@ -153,7 +160,7 @@ export default (options) => {
|
|||
ident: 'postcss',
|
||||
plugins: [
|
||||
autoprefixer({
|
||||
browsers: '> 1%, last 4 versions, Firefox ESR, ios >= 8',
|
||||
browsers: autoprefixerTargets,
|
||||
grid: false,
|
||||
}),
|
||||
],
|
||||
|
@ -190,7 +197,7 @@ export default (options) => {
|
|||
return cssLoaders;
|
||||
}
|
||||
|
||||
return {
|
||||
const config = {
|
||||
devServer: {
|
||||
// inline: true,
|
||||
headers: {
|
||||
|
@ -214,11 +221,34 @@ export default (options) => {
|
|||
exclude: /node_modules/,
|
||||
options: {
|
||||
// Look for babel configuration in project directory
|
||||
babelrc: true,
|
||||
babelrc: false,
|
||||
// Cache transformations to the filesystem (in default temp dir)
|
||||
cacheDirectory: true,
|
||||
// Skip module transpiling as Webpack 2+ support it ootb
|
||||
|
||||
forceEnv: 'browser',
|
||||
|
||||
presets: [
|
||||
['babel-preset-env', {
|
||||
targets: {
|
||||
browsers: autoprefixerTargets,
|
||||
uglify: false,
|
||||
},
|
||||
// spec: true,
|
||||
debug: development,
|
||||
modules: false, // do not transpile modules, webpack 2+ does that
|
||||
}],
|
||||
'babel-preset-react',
|
||||
],
|
||||
plugins: [
|
||||
'babel-plugin-transform-react-constant-elements',
|
||||
'babel-plugin-transform-class-properties',
|
||||
['babel-plugin-transform-runtime', {
|
||||
helpers: false,
|
||||
polyfill: false,
|
||||
regenerator: true,
|
||||
}],
|
||||
'babel-plugin-syntax-dynamic-import',
|
||||
],
|
||||
},
|
||||
},
|
||||
...[
|
||||
|
|
Loading…
Reference in New Issue