From 5b7f6299966b5556b8bc4fc021a9e9d2e5099604 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 8 Nov 2016 15:46:21 +0000 Subject: [PATCH] Build to the 'webapp' directory instead People may have config files in vector/ so it would be nonideal if we started overwriting them / blowing them away. --- electron/src/electron-main.js | 2 +- package.json | 18 +++++++++--------- scripts/package.sh | 3 ++- webpack.config.js | 6 +++--- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/electron/src/electron-main.js b/electron/src/electron-main.js index 59cbca428e..18758eee90 100644 --- a/electron/src/electron-main.js +++ b/electron/src/electron-main.js @@ -160,7 +160,7 @@ electron.app.on('ready', () => { icon: `${__dirname}/../img/riot.ico`, width: 1024, height: 768, }); - mainWindow.loadURL(`file://${__dirname}/../../vector/index.html`); + mainWindow.loadURL(`file://${__dirname}/../../webapp/index.html`); electron.Menu.setApplicationMenu(VectorMenu); mainWindow.on('closed', () => { diff --git a/package.json b/package.json index bf3b43e1f0..93bfaceab9 100644 --- a/package.json +++ b/package.json @@ -27,9 +27,9 @@ "matrix-react-parent": "matrix-react-sdk", "scripts": { "reskindex": "reskindex -h src/header", - "build:res": "cpx \"{src/skins/vector/fonts,src/skins/vector/img}/**\" vector/ && cpx \"{res/media,res/vector-icons}/**\" vector/", - "build:config": "cpx config.json vector/", - "build:emojione": "cpx \"node_modules/emojione/assets/svg/*\" vector/emojione/svg/", + "build:res": "cpx \"{src/skins/vector/fonts,src/skins/vector/img}/**\" webapp/ && cpx \"{res/media,res/vector-icons}/**\" webapp/", + "build:config": "cpx config.json webapp/", + "build:emojione": "cpx \"node_modules/emojione/assets/svg/*\" webapp/emojione/svg/", "build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js", "build:css": "mkdirp build && catw \"src/skins/vector/css/**/*.css\" -o build/components.css --no-watch", "build:compile": "babel --source-maps -d lib src", @@ -39,15 +39,15 @@ "build": "node scripts/babelcheck.js && npm run build:res && npm run build:config && npm run build:emojione && npm run build:css && npm run build:bundle", "build:dev": "npm run build:emojione && npm run build:css && npm run build:bundle:dev", "dist": "scripts/package.sh", - "start:res": "parallelshell \"cpx -w \\\"{src/skins/vector/fonts,src/skins/vector/img}/**\\\" vector/\" \"cpx -w \\\"{res/media,res/vector-icons}/**\\\" vector/\"", - "start:config": "cpx -w config.json vector/", - "start:emojione": "cpx \"node_modules/emojione/assets/svg/*\" vector/emojione/svg/ -w", + "start:res": "parallelshell \"cpx -w \\\"{src/skins/vector/fonts,src/skins/vector/img}/**\\\" webapp/\" \"cpx -w \\\"{res/media,res/vector-icons}/**\\\" webapp/\"", + "start:config": "cpx -w config.json webapp/", + "start:emojione": "cpx \"node_modules/emojione/assets/svg/*\" webapp/emojione/svg/ -w", "start:js": "webpack-dev-server -w --progress", "start:js:prod": "NODE_ENV=production webpack-dev-server -w --progress", "start:skins:css": "mkdirp build && catw \"src/skins/vector/css/**/*.css\" -o build/components.css", "start": "node scripts/babelcheck.js && parallelshell \"npm run start:emojione\" \"npm run start:res\" \"npm run start:config\" \"npm run start:js\" \"npm run start:skins:css\"", "start:prod": "parallelshell \"npm run start:emojione\" \"npm run start:js:prod\" \"npm run start:skins:css\"", - "clean": "rimraf build lib vector", + "clean": "rimraf build lib webapp", "prepublish": "npm run build:compile", "test": "karma start --single-run=true --autoWatch=false --browsers PhantomJS --colors=false", "test:multi": "karma start" @@ -132,12 +132,12 @@ "//asar=false": "https://github.com/electron-userland/electron-builder/issues/675", "asar": false, "dereference": true, - "//files": "We bundle everything, so we only need to include vector/", + "//files": "We bundle everything, so we only need to include webapp/", "files": [ "!**/*", "electron/src/**", "electron/img/**", - "vector/**", + "webapp/**", "package.json" ], "squirrelWindows": { diff --git a/scripts/package.sh b/scripts/package.sh index d5deffef64..35f6f92a5a 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -8,9 +8,10 @@ else version=`git describe --dirty --tags || echo unknown` fi +npm run clean npm run build mkdir -p dist -cp -r vector vector-$version +cp -r webapp vector-$version echo $version > vector-$version/version tar chvzf dist/vector-$version.tar.gz vector-$version rm -r vector-$version diff --git a/webpack.config.js b/webpack.config.js index 5d669bd2c3..4f350dd431 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -39,7 +39,7 @@ module.exports = { ], }, output: { - path: path.join(__dirname, "vector"), + path: path.join(__dirname, "webapp"), filename: "[name].[chunkhash].js", devtoolModuleFilenameTemplate: function(info) { // Reading input source maps gives only relative paths here for @@ -98,8 +98,8 @@ module.exports = { // configuration for the webpack-dev-server devServer: { - // serve unwebpacked assets from vector. - contentBase: './vector', + // serve unwebpacked assets from webapp. + contentBase: './webapp', }, };