Merge pull request #822 from yuya-oc/upgrade-build-tools
Upgrade build tools
This commit is contained in:
27
package.json
27
package.json
@@ -17,8 +17,8 @@
|
|||||||
"postinstall": "electron-builder install-app-deps && npm run extract-dict",
|
"postinstall": "electron-builder install-app-deps && npm run extract-dict",
|
||||||
"extract-dict": "node scripts/extract_dict.js src/node_modules/simple-spellchecker/dict",
|
"extract-dict": "node scripts/extract_dict.js src/node_modules/simple-spellchecker/dict",
|
||||||
"build": "npm-run-all build:*",
|
"build": "npm-run-all build:*",
|
||||||
"build:main": "webpack --bail --config webpack.config.main.js",
|
"build:main": "webpack-cli --bail --config webpack.config.main.js",
|
||||||
"build:renderer": "webpack --bail --config webpack.config.renderer.js",
|
"build:renderer": "webpack-cli --bail --config webpack.config.renderer.js",
|
||||||
"start": "electron src --disable-dev-mode",
|
"start": "electron src --disable-dev-mode",
|
||||||
"storybook": "start-storybook -p 9001 -c src/.storybook",
|
"storybook": "start-storybook -p 9001 -c src/.storybook",
|
||||||
"clean": "rm -rf release/ node_modules/ src/node_modules/ && find src -name '*_bundle.js' | xargs rm",
|
"clean": "rm -rf release/ node_modules/ src/node_modules/ && find src -name '*_bundle.js' | xargs rm",
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"watch:main": "node scripts/watch_main_and_preload.js",
|
"watch:main": "node scripts/watch_main_and_preload.js",
|
||||||
"watch:renderer": "webpack-dev-server --config webpack.config.renderer.js",
|
"watch:renderer": "webpack-dev-server --config webpack.config.renderer.js",
|
||||||
"test": "npm-run-all test:* lint:*",
|
"test": "npm-run-all test:* lint:*",
|
||||||
"test:app": "npm run build && mocha -r babel-register --reporter mocha-circleci-reporter --recursive test/specs",
|
"test:app": "cross-env NODE_ENV=production npm run build && mocha -r babel-register --reporter mocha-circleci-reporter --recursive test/specs",
|
||||||
"package:all": "cross-env NODE_ENV=production npm-run-all check-build-config package:windows package:mac package:linux",
|
"package:all": "cross-env NODE_ENV=production npm-run-all check-build-config package:windows package:mac package:linux",
|
||||||
"package:windows": "cross-env NODE_ENV=production npm-run-all check-build-config build && build --win --x64 --ia32 --config.extraMetadata.name=mattermost --publish=never && npm run manipulate-windows-zip",
|
"package:windows": "cross-env NODE_ENV=production npm-run-all check-build-config build && build --win --x64 --ia32 --config.extraMetadata.name=mattermost --publish=never && npm run manipulate-windows-zip",
|
||||||
"package:mac": "cross-env NODE_ENV=production npm-run-all check-build-config build && build --mac --publish=never",
|
"package:mac": "cross-env NODE_ENV=production npm-run-all check-build-config build && build --mac --publish=never",
|
||||||
@@ -39,15 +39,15 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"7zip-bin": "^2.4.1",
|
"7zip-bin": "^2.4.1",
|
||||||
"@storybook/react": "^3.4.1",
|
"@storybook/react": "^3.4.1",
|
||||||
"babel-core": "^6.26.0",
|
"babel-core": "^6.26.3",
|
||||||
"babel-eslint": "^8.2.1",
|
"babel-eslint": "^8.2.3",
|
||||||
"babel-loader": "^7.1.2",
|
"babel-loader": "^7.1.4",
|
||||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||||
"babel-preset-env": "^1.6.1",
|
"babel-preset-env": "^1.7.0",
|
||||||
"babel-preset-react": "^6.24.1",
|
"babel-preset-react": "^6.24.1",
|
||||||
"chai": "^4.1.2",
|
"chai": "^4.1.2",
|
||||||
"cross-env": "^5.1.3",
|
"cross-env": "^5.1.3",
|
||||||
"css-loader": "^0.28.9",
|
"css-loader": "^0.28.11",
|
||||||
"devtron": "^1.4.0",
|
"devtron": "^1.4.0",
|
||||||
"electron": "2.0.2",
|
"electron": "2.0.2",
|
||||||
"electron-builder": "20.14.7",
|
"electron-builder": "20.14.7",
|
||||||
@@ -63,10 +63,11 @@
|
|||||||
"react": "^16.2.0",
|
"react": "^16.2.0",
|
||||||
"react-dom": "^16.2.0",
|
"react-dom": "^16.2.0",
|
||||||
"spectron": "~3.8.0",
|
"spectron": "~3.8.0",
|
||||||
"style-loader": "^0.20.1",
|
"style-loader": "^0.21.0",
|
||||||
"url-loader": "^0.6.2",
|
"url-loader": "^1.0.1",
|
||||||
"webpack": "^3.10.0",
|
"webpack": "^4.8.3",
|
||||||
"webpack-dev-server": "^2.11.1",
|
"webpack-cli": "^2.1.4",
|
||||||
"webpack-merge": "^4.1.1"
|
"webpack-dev-server": "^3.1.4",
|
||||||
|
"webpack-merge": "^4.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -386,7 +386,8 @@ describe('browser/settings.html', function desc() {
|
|||||||
env.addClientCommands(this.app.client);
|
env.addClientCommands(this.app.client);
|
||||||
return this.app.client.
|
return this.app.client.
|
||||||
loadSettingsPage().
|
loadSettingsPage().
|
||||||
click('#addNewServer');
|
click('#addNewServer').
|
||||||
|
pause(1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should open the new server modal', () => {
|
it('should open the new server modal', () => {
|
||||||
@@ -407,7 +408,7 @@ describe('browser/settings.html', function desc() {
|
|||||||
it('should not be valid if no team name has been set', () => {
|
it('should not be valid if no team name has been set', () => {
|
||||||
return this.app.client.
|
return this.app.client.
|
||||||
click('#saveNewServerModal').
|
click('#saveNewServerModal').
|
||||||
pause(500).
|
waitForExist('.has-error #teamNameInput', 10000).
|
||||||
isExisting('.has-error #teamNameInput').then((existing) => {
|
isExisting('.has-error #teamNameInput').then((existing) => {
|
||||||
existing.should.be.true;
|
existing.should.be.true;
|
||||||
});
|
});
|
||||||
@@ -416,7 +417,7 @@ describe('browser/settings.html', function desc() {
|
|||||||
it('should not be valid if no server address has been set', () => {
|
it('should not be valid if no server address has been set', () => {
|
||||||
return this.app.client.
|
return this.app.client.
|
||||||
click('#saveNewServerModal').
|
click('#saveNewServerModal').
|
||||||
pause(500).
|
waitForExist('.has-error #teamUrlInput', 10000).
|
||||||
isExisting('.has-error #teamUrlInput').then((existing) => {
|
isExisting('.has-error #teamUrlInput').then((existing) => {
|
||||||
existing.should.be.true;
|
existing.should.be.true;
|
||||||
});
|
});
|
||||||
|
@@ -1,8 +1,17 @@
|
|||||||
/* eslint-disable import/no-commonjs */
|
/* eslint-disable import/no-commonjs */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const webpack = require('webpack');
|
||||||
|
|
||||||
const isProduction = process.env.NODE_ENV === 'production';
|
const isProduction = process.env.NODE_ENV === 'production';
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
||||||
|
// Some plugins cause errors on the app, so use few plugins.
|
||||||
|
// https://webpack.js.org/concepts/mode/#mode-production
|
||||||
|
mode: isProduction ? 'none' : 'development',
|
||||||
|
plugins: isProduction ? [
|
||||||
|
new webpack.DefinePlugin({'process.env.NODE_ENV': JSON.stringify('production')}),
|
||||||
|
] : [],
|
||||||
devtool: isProduction ? false : '#inline-source-map',
|
devtool: isProduction ? false : '#inline-source-map',
|
||||||
};
|
};
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
/* eslint-disable import/no-commonjs */
|
/* eslint-disable import/no-commonjs */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
const merge = require('webpack-merge');
|
const merge = require('webpack-merge');
|
||||||
|
|
||||||
const base = require('./webpack.config.base');
|
const base = require('./webpack.config.base');
|
||||||
@@ -8,7 +10,8 @@ const base = require('./webpack.config.base');
|
|||||||
module.exports = merge(base, {
|
module.exports = merge(base, {
|
||||||
entry: './src/main.js',
|
entry: './src/main.js',
|
||||||
output: {
|
output: {
|
||||||
filename: './src/[name]_bundle.js',
|
path: path.join(__dirname, 'src'),
|
||||||
|
filename: '[name]_bundle.js',
|
||||||
},
|
},
|
||||||
node: {
|
node: {
|
||||||
__filename: true,
|
__filename: true,
|
||||||
|
Reference in New Issue
Block a user