1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-10 21:30:06 +02:00

fix production "Unexpected token" error

This commit is contained in:
Sérgio Ramos 2017-02-23 17:24:18 +00:00
parent c48bd28ddf
commit 7ce458fe2d
4 changed files with 34 additions and 24 deletions

View File

@ -44,7 +44,7 @@
}, },
"production": { "production": {
"plugins": [ "plugins": [
"transform-react-constant-elements" // "transform-react-constant-elements" enable when #5325 is fixed
] ]
} }
} }

View File

@ -9,8 +9,7 @@ const {
MODULES, MODULES,
FRONTEND, FRONTEND,
UI, UI,
STATIC, STATIC
ESLINT
} = paths; } = paths;
module.exports = { module.exports = {
@ -39,23 +38,13 @@ module.exports = {
}, },
plugins: [ plugins: [
plugins['define'](), plugins['define'](),
plugins['shell']() plugins['shell'](),
plugins['named-modules'](),
plugins['case-sensitive-paths']()
], ],
module: { module: {
rules: [{ rules: [{
test: /js?$/,
enforce: 'pre',
use: [{
loader: 'eslint-loader',
options: {
configFile: ESLINT
}
}],
include: [
FRONTEND,
UI
]
}, {
exclude: [ exclude: [
/\.html$/, /\.html$/,
/\.(js|jsx)$/, /\.(js|jsx)$/,

View File

@ -1,6 +1,13 @@
// const graphql = require('../../cloudapi-graphql/src/endpoint'); // const graphql = require('../../cloudapi-graphql/src/endpoint');
const plugins = require('./plugins'); const plugins = require('./plugins');
const base = require('./base'); const base = require('./base');
const paths = require('./paths');
const {
FRONTEND,
UI,
ESLINT
} = paths;
const devServer = { const devServer = {
hot: true, hot: true,
@ -26,11 +33,25 @@ module.exports = Object.assign(base, {
'react-dev-utils/webpackHotDevClient', 'react-dev-utils/webpackHotDevClient',
base.entry base.entry
], ],
module: {
rules: base.module.rules.concat([{
test: /js?$/,
enforce: 'pre',
use: [{
loader: 'eslint-loader',
options: {
configFile: ESLINT
}
}],
include: [
FRONTEND,
UI
]
}])
},
plugins: base.plugins.concat([ plugins: base.plugins.concat([
plugins['named-modules'](),
plugins['hot-module-replacement'](), plugins['hot-module-replacement'](),
plugins['watch-missing-node-modules'](), plugins['watch-missing-node-modules']()
plugins['case-sensitive-paths']()
]), ]),
node: { node: {
fs: 'empty', fs: 'empty',

View File

@ -1332,8 +1332,8 @@ babel-types@^6.15.0, babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19
to-fast-properties "^1.0.1" to-fast-properties "^1.0.1"
babylon@^6.1.0, babylon@^6.10.0, babylon@^6.11.0, babylon@^6.12.0, babylon@^6.13.0, babylon@^6.15.0: babylon@^6.1.0, babylon@^6.10.0, babylon@^6.11.0, babylon@^6.12.0, babylon@^6.13.0, babylon@^6.15.0:
version "6.15.0" version "6.16.1"
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3"
babylon@~5.8.3: babylon@~5.8.3:
version "5.8.38" version "5.8.38"
@ -1543,8 +1543,8 @@ caniuse-api@^1.5.2:
lodash.uniq "^4.3.0" lodash.uniq "^4.3.0"
caniuse-db@^1.0.30000187, caniuse-db@^1.0.30000346, caniuse-db@^1.0.30000624: caniuse-db@^1.0.30000187, caniuse-db@^1.0.30000346, caniuse-db@^1.0.30000624:
version "1.0.30000624" version "1.0.30000626"
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000624.tgz#554b87547895e36f5fe128f4b7448a2ea5bf2213" resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000626.tgz#44363dc86857efaf758fea9faef6a15ed93d8f33"
capture-stack-trace@^1.0.0: capture-stack-trace@^1.0.0:
version "1.0.0" version "1.0.0"