mirror of
https://github.com/vector-im/element-web.git
synced 2024-09-09 22:55:12 +00:00
Switch to webpack
Webapck actually supports loading input source maps and generally seems a lot more solid then browserify (even if their website has an annoying animated logo).
This commit is contained in:
parent
bfa4cda2c6
commit
f020f4397c
4 changed files with 40 additions and 10 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,3 +1,3 @@
|
||||||
node_modules
|
node_modules
|
||||||
bundle.css
|
vector/bundle.*
|
||||||
bundle.js
|
lib
|
||||||
|
|
19
package.json
19
package.json
|
@ -11,13 +11,15 @@
|
||||||
"style": "bundle.css",
|
"style": "bundle.css",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"reskindex": "reskindex vector -h src/skins/vector/header",
|
"reskindex": "reskindex vector -h src/skins/vector/header",
|
||||||
"build": "NODE_ENV=production browserify --ignore olm -t reactify vector/index.js | uglifyjs -c -m -o vector/bundle.js",
|
"build:css": "catw 'src/skins/vector/css/**/*.css' -o vector/bundle.css -c uglifycss --no-watch",
|
||||||
"start": "parallelshell 'watchify --ignore olm -v -d -t reactify vector/index.js -o vector/bundle.js' 'npm run start:skins:css' 'http-server vector'",
|
"build:compile": "babel --source-maps -d lib src",
|
||||||
"build:skins:js": "babel src/skins -d lib/skins --source-maps",
|
"build:bundle": "NODE_ENV=production webpack -p lib/vector/index.js vector/bundle.js",
|
||||||
"build:skins:css": "catw 'src/skins/vector/css/**/*.css' -o vector/bundle.css -c uglifycss --no-watch",
|
"build": "npm run build:css && npm run build:compile && npm run build:bundle",
|
||||||
|
"start:js": "webpack -w src/vector/index.js vector/bundle.js",
|
||||||
"start:skins:css": "catw 'src/skins/vector/css/**/*.css' -o vector/bundle.css",
|
"start:skins:css": "catw 'src/skins/vector/css/**/*.css' -o vector/bundle.css",
|
||||||
"clean": "rimraf lib vector/bundle.css vector/bundle.js",
|
"start": "parallelshell 'npm run start:js' 'npm run start:skins:css' 'http-server vector'",
|
||||||
"prepublish": "npm run build:skins"
|
"clean": "rimraf lib vector/bundle.css vector/bundle.js vector/bundle.js.map vector/bundle.webpack.js vector/bundle.webpack.js.map",
|
||||||
|
"prepublish": "npm run build:css && npm run build:compile"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"matrix-react-sdk": "^0.0.1",
|
"matrix-react-sdk": "^0.0.1",
|
||||||
|
@ -31,10 +33,13 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel": "^5.8.23",
|
"babel": "^5.8.23",
|
||||||
|
"babel-core": "^5.8.25",
|
||||||
|
"babel-loader": "^5.3.2",
|
||||||
"catw": "^1.0.1",
|
"catw": "^1.0.1",
|
||||||
|
"http-server": "^0.8.4",
|
||||||
"parallelshell": "^1.2.0",
|
"parallelshell": "^1.2.0",
|
||||||
"react-tools": "^0.13.3",
|
|
||||||
"rimraf": "^2.4.3",
|
"rimraf": "^2.4.3",
|
||||||
|
"source-map-loader": "^0.1.5",
|
||||||
"uglifycss": "0.0.15"
|
"uglifycss": "0.0.15"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ limitations under the License.
|
||||||
|
|
||||||
var React = require("react");
|
var React = require("react");
|
||||||
var sdk = require("matrix-react-sdk");
|
var sdk = require("matrix-react-sdk");
|
||||||
sdk.loadSkin(require('../src/skins/vector/skindex'));
|
sdk.loadSkin(require('../skins/vector/skindex'));
|
||||||
|
|
||||||
var lastLocationHashSet = null;
|
var lastLocationHashSet = null;
|
||||||
|
|
25
webpack.config.js
Normal file
25
webpack.config.js
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
var path = require('path');
|
||||||
|
var webpack = require('webpack');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
module: {
|
||||||
|
preLoaders: [
|
||||||
|
{ test: /\.js$/, loader: "source-map-loader" }
|
||||||
|
],
|
||||||
|
loaders: [
|
||||||
|
{ test: /\.json$/, loader: "json" },
|
||||||
|
{ test: /\.js$/, loader: "babel", include: path.resolve('./src') },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
// alias any requires to the react module to the one in our path, otherwise
|
||||||
|
// we tend to get the react source included twice when using npm link.
|
||||||
|
react: path.resolve('./node_modules/react'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new webpack.IgnorePlugin(/^olm/)
|
||||||
|
],
|
||||||
|
devtool: 'source-map'
|
||||||
|
};
|
Loading…
Reference in a new issue