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.
This commit is contained in:
David Baker 2016-11-08 15:46:21 +00:00
parent a4c16b896b
commit 5b7f629996
4 changed files with 15 additions and 14 deletions

View file

@ -160,7 +160,7 @@ electron.app.on('ready', () => {
icon: `${__dirname}/../img/riot.ico`, icon: `${__dirname}/../img/riot.ico`,
width: 1024, height: 768, width: 1024, height: 768,
}); });
mainWindow.loadURL(`file://${__dirname}/../../vector/index.html`); mainWindow.loadURL(`file://${__dirname}/../../webapp/index.html`);
electron.Menu.setApplicationMenu(VectorMenu); electron.Menu.setApplicationMenu(VectorMenu);
mainWindow.on('closed', () => { mainWindow.on('closed', () => {

View file

@ -27,9 +27,9 @@
"matrix-react-parent": "matrix-react-sdk", "matrix-react-parent": "matrix-react-sdk",
"scripts": { "scripts": {
"reskindex": "reskindex -h src/header", "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:res": "cpx \"{src/skins/vector/fonts,src/skins/vector/img}/**\" webapp/ && cpx \"{res/media,res/vector-icons}/**\" webapp/",
"build:config": "cpx config.json vector/", "build:config": "cpx config.json webapp/",
"build:emojione": "cpx \"node_modules/emojione/assets/svg/*\" vector/emojione/svg/", "build:emojione": "cpx \"node_modules/emojione/assets/svg/*\" webapp/emojione/svg/",
"build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js", "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:css": "mkdirp build && catw \"src/skins/vector/css/**/*.css\" -o build/components.css --no-watch",
"build:compile": "babel --source-maps -d lib src", "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": "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", "build:dev": "npm run build:emojione && npm run build:css && npm run build:bundle:dev",
"dist": "scripts/package.sh", "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: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 vector/", "start:config": "cpx -w config.json webapp/",
"start:emojione": "cpx \"node_modules/emojione/assets/svg/*\" vector/emojione/svg/ -w", "start:emojione": "cpx \"node_modules/emojione/assets/svg/*\" webapp/emojione/svg/ -w",
"start:js": "webpack-dev-server -w --progress", "start:js": "webpack-dev-server -w --progress",
"start:js:prod": "NODE_ENV=production 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: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": "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\"", "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", "prepublish": "npm run build:compile",
"test": "karma start --single-run=true --autoWatch=false --browsers PhantomJS --colors=false", "test": "karma start --single-run=true --autoWatch=false --browsers PhantomJS --colors=false",
"test:multi": "karma start" "test:multi": "karma start"
@ -132,12 +132,12 @@
"//asar=false": "https://github.com/electron-userland/electron-builder/issues/675", "//asar=false": "https://github.com/electron-userland/electron-builder/issues/675",
"asar": false, "asar": false,
"dereference": true, "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": [ "files": [
"!**/*", "!**/*",
"electron/src/**", "electron/src/**",
"electron/img/**", "electron/img/**",
"vector/**", "webapp/**",
"package.json" "package.json"
], ],
"squirrelWindows": { "squirrelWindows": {

View file

@ -8,9 +8,10 @@ else
version=`git describe --dirty --tags || echo unknown` version=`git describe --dirty --tags || echo unknown`
fi fi
npm run clean
npm run build npm run build
mkdir -p dist mkdir -p dist
cp -r vector vector-$version cp -r webapp vector-$version
echo $version > vector-$version/version echo $version > vector-$version/version
tar chvzf dist/vector-$version.tar.gz vector-$version tar chvzf dist/vector-$version.tar.gz vector-$version
rm -r vector-$version rm -r vector-$version

View file

@ -39,7 +39,7 @@ module.exports = {
], ],
}, },
output: { output: {
path: path.join(__dirname, "vector"), path: path.join(__dirname, "webapp"),
filename: "[name].[chunkhash].js", filename: "[name].[chunkhash].js",
devtoolModuleFilenameTemplate: function(info) { devtoolModuleFilenameTemplate: function(info) {
// Reading input source maps gives only relative paths here for // Reading input source maps gives only relative paths here for
@ -98,8 +98,8 @@ module.exports = {
// configuration for the webpack-dev-server // configuration for the webpack-dev-server
devServer: { devServer: {
// serve unwebpacked assets from vector. // serve unwebpacked assets from webapp.
contentBase: './vector', contentBase: './webapp',
}, },
}; };