Skip to content

Commit

Permalink
Merge 969206f into 07bd216
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Jul 28, 2018
2 parents 07bd216 + 969206f commit cf643b7
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -176,7 +176,7 @@ after_success:
fi
- |
# docker image
if [[ "$TRAVIS_NODE_VERSION" == "6" && "$TRAVIS_OS_NAME" == "linux" ]]; then
if [[ "$TRAVIS_NODE_VERSION" == "8" && "$TRAVIS_OS_NAME" == "linux" ]]; then
travis_wait scripts/travis-docker-build.sh;
fi
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
@@ -1,10 +1,9 @@
# NodeSource Docker Images
# https://github.com/nodesource/docker-node
FROM nodesource/vivid:6
FROM node:8
MAINTAINER Cheton Wu <cheton@gmail.com>

# cache package.json and node_modules to speed up builds
ADD package.json package.json
RUN npm i npm@latest -g
RUN npm install --production
RUN npm install -g nodemon

Expand Down
9 changes: 5 additions & 4 deletions package.json
Expand Up @@ -191,7 +191,7 @@
"history": "~4.7.2",
"hogan.js": "~3.0.2",
"http-proxy": "~1.17.0",
"i18next": "~11.4.0",
"i18next": "~11.5.0",
"i18next-browser-languagedetector": "~2.2.2",
"i18next-express-middleware": "~1.2.0",
"i18next-node-fs-backend": "~1.2.1",
Expand Down Expand Up @@ -286,8 +286,8 @@
"css-split-webpack-plugin": "~0.2.5",
"dotenv": "~6.0.0",
"electron": "~2.0.5",
"electron-builder": "~19.50.0",
"electron-rebuild": "~1.7.3",
"electron-builder": "~20.26.0",
"electron-rebuild": "~1.8.1",
"eslint": "~5.2.0",
"eslint-config-trendmicro": "~1.4.1",
"eslint-import-resolver-webpack": "~0.10.1",
Expand Down Expand Up @@ -322,12 +322,13 @@
"transform-loader": "~0.2.4",
"uglifyjs-webpack-plugin": "~1.2.7",
"url-loader": "~1.0.1",
"webpack": "~4.16.2",
"webpack": "~4.16.3",
"webpack-cli": "~3.1.0",
"webpack-dev-middleware": "~3.1.3",
"webpack-dev-server": "~3.1.5",
"webpack-hot-middleware": "~2.22.3",
"webpack-manifest-plugin": "~2.0.3",
"webpack-node-externals": "~1.7.2",
"write-file-webpack-plugin": "~4.3.2"
},
"pre-push": [
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Expand Up @@ -36,7 +36,7 @@
"gcode-parser": "~1.3.6",
"hogan.js": "~3.0.2",
"http-proxy": "~1.17.0",
"i18next": "~11.4.0",
"i18next": "~11.5.0",
"i18next-express-middleware": "~1.2.0",
"i18next-node-fs-backend": "~1.2.1",
"is-electron": "~2.1.0",
Expand Down
22 changes: 6 additions & 16 deletions webpack.appconfig.development.js
@@ -1,21 +1,9 @@
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const nodeExternals = require('webpack-node-externals');
const pkg = require('./package.json');

const NODE_MODULES = path.resolve(__dirname, 'node_modules');

// http://jlongster.com/Backend-Apps-with-Webpack--Part-I
const externals = {};
fs.readdirSync(NODE_MODULES)
.filter(x => {
return ['.bin'].indexOf(x) === -1;
})
.forEach(mod => {
externals[mod] = 'commonjs ' + mod;
});

// Use publicPath for production
const payload = pkg.version;
const publicPath = ((payload) => {
Expand All @@ -29,7 +17,7 @@ const buildVersion = pkg.version;
module.exports = {
mode: 'development',
devtool: 'cheap-module-eval-source-map',
target: 'node',
target: 'node', // ignore built-in modules like path, fs, etc.
context: path.resolve(__dirname, 'src/app'),
entry: {
index: [
Expand Down Expand Up @@ -64,12 +52,14 @@ module.exports = {
}
]
},
externals: externals,
externals: [nodeExternals()], // ignore all modules in node_modules folder
resolve: {
extensions: ['.js', '.jsx']
},
resolveLoader: {
modules: [NODE_MODULES]
modules: [
path.resolve(__dirname, 'node_modules')
]
},
node: {
console: true,
Expand Down
22 changes: 6 additions & 16 deletions webpack.appconfig.production.js
@@ -1,21 +1,9 @@
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const nodeExternals = require('webpack-node-externals');
const pkg = require('./package.json');

const NODE_MODULES = path.resolve(__dirname, 'node_modules');

// http://jlongster.com/Backend-Apps-with-Webpack--Part-I
const externals = {};
fs.readdirSync(NODE_MODULES)
.filter(x => {
return ['.bin'].indexOf(x) === -1;
})
.forEach(mod => {
externals[mod] = 'commonjs ' + mod;
});

// Use publicPath for production
const payload = pkg.version;
const publicPath = ((payload) => {
Expand All @@ -29,7 +17,7 @@ const buildVersion = pkg.version;
module.exports = {
mode: 'production',
devtool: 'cheap-module-source-map',
target: 'node',
target: 'node', // ignore built-in modules like path, fs, etc.
context: path.resolve(__dirname, 'src/app'),
entry: {
index: [
Expand Down Expand Up @@ -63,12 +51,14 @@ module.exports = {
}
]
},
externals: externals,
externals: [nodeExternals()], // ignore all modules in node_modules folder
resolve: {
extensions: ['.js', '.jsx']
},
resolveLoader: {
modules: [NODE_MODULES]
modules: [
path.resolve(__dirname, 'node_modules')
]
},
node: {
console: true,
Expand Down

0 comments on commit cf643b7

Please sign in to comment.