diff --git a/.gitignore b/.gitignore index 46368a6446..2abed01fe1 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,6 @@ /vector/bundle.* /vector/emojione/ /vector/config.json -/vector/olm.js +/vector/olm.* .DS_Store npm-debug.log diff --git a/package.json b/package.json index 9c5b29494b..95eff53184 100644 --- a/package.json +++ b/package.json @@ -16,21 +16,19 @@ "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", - "build:bundle": "NODE_ENV=production webpack -p lib/vector/index.js vector/bundle.js", - "build:bundle:dev": "webpack --optimize-occurence-order lib/vector/index.js vector/bundle.js", - "build:staticfiles": "cpx -v node_modules/olm/olm.js vector/", - "build": "node scripts/babelcheck.js && npm run build:staticfiles && npm run build:emojione && npm run build:css && npm run build:compile && npm run build:bundle", - "build:dev": "npm run build:staticfiles && npm run build:emojione && npm run build:css && npm run build:compile && npm run build:bundle:dev", + "build:bundle": "NODE_ENV=production webpack -p --progress", + "build:bundle:dev": "webpack --optimize-occurence-order --progress", + "build": "node scripts/babelcheck.js && 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", "package": "scripts/package.sh", "start:emojione": "cpx \"node_modules/emojione/assets/svg/*\" vector/emojione/svg/ -w", - "start:js": "webpack -w src/vector/index.js vector/bundle.js", - "start:js:prod": "NODE_ENV=production webpack -w src/vector/index.js vector/bundle.js", + "start:js": "webpack -w --progress", + "start:js:prod": "NODE_ENV=production webpack -w --progress", "start:skins:css": "mkdirp build && catw \"src/skins/vector/css/**/*.css\" -o build/components.css", - "start:staticfiles": "cpx -Lwv node_modules/olm/olm.js vector/", "//cache": "Note the -c 1 below due to https://code.google.com/p/chromium/issues/detail?id=508270", - "start": "node scripts/babelcheck.js && parallelshell \"npm run start:staticfiles\" \"npm run start:emojione\" \"npm run start:js\" \"npm run start:skins:css\" \"http-server -c 1 vector\"", - "start:prod": "parallelshell \"npm run start:staticfiles\" \"npm run start:emojione\" \"npm run start:js:prod\" \"npm run start:skins:css\" \"http-server -c 1 vector\"", - "clean": "rimraf build lib vector/olm.js vector/bundle.css vector/bundle.js vector/bundle.js.map vector/webpack.css* vector/emojione", + "start": "node scripts/babelcheck.js && parallelshell \"npm run start:emojione\" \"npm run start:js\" \"npm run start:skins:css\" \"http-server -c 1 vector\"", + "start:prod": "parallelshell \"npm run start:emojione\" \"npm run start:js:prod\" \"npm run start:skins:css\" \"http-server -c 1 vector\"", + "clean": "rimraf build lib vector/olm.* vector/bundle.* vector/emojione", "prepublish": "npm run build:css && npm run build:compile", "test": "karma start --single-run=true --autoWatch=false --browsers PhantomJS --colors=false", "test:multi": "karma start" diff --git a/webpack.config.js b/webpack.config.js index 95afcfba98..4d5747f689 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,6 +3,18 @@ var webpack = require('webpack'); var ExtractTextPlugin = require("extract-text-webpack-plugin"); module.exports = { + entry: { + "bundle": "./src/vector/index.js", + + // We ship olm.js as a separate lump of javascript. This makes it get + // loaded via a separate