Added Webpack integration
This commit allows to create js-openstack-lib build which can be used in browsers. Webpack library is used to create the build. Change-Id: I382244c9399cee83720858d0bb2768e9ce3b7c9a
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
"test": "jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json",
|
"test": "jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json",
|
||||||
"lint": "eslint ./",
|
"lint": "eslint ./",
|
||||||
"prepublish": "nsp check; npm run build",
|
"prepublish": "nsp check; npm run build",
|
||||||
"build": "babel src -d dist",
|
"build": "babel src -d dist && webpack",
|
||||||
"doc": "(cd ./doc && make html)"
|
"doc": "(cd ./doc && make html)"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -27,12 +27,14 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-cli": "^6.10.1",
|
"babel-cli": "^6.10.1",
|
||||||
"babel-core": "^6.10.4",
|
"babel-core": "^6.10.4",
|
||||||
|
"babel-loader": "^6.2.4",
|
||||||
"babel-preset-es2015": "^6.9.0",
|
"babel-preset-es2015": "^6.9.0",
|
||||||
"babel-register": "^6.9.0",
|
"babel-register": "^6.9.0",
|
||||||
"eslint": "^2.4.0",
|
"eslint": "^2.4.0",
|
||||||
"eslint-config-openstack": "2.0.0",
|
"eslint-config-openstack": "2.0.0",
|
||||||
"jasmine": "^2.4.1",
|
"jasmine": "^2.4.1",
|
||||||
"nsp": "^2.4.0"
|
"nsp": "^2.4.0",
|
||||||
|
"webpack": "^1.13.1"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
|
18
webpack.config.babel.js
Normal file
18
webpack.config.babel.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
export default {
|
||||||
|
entry: ['./src/index.js'],
|
||||||
|
output: {
|
||||||
|
path: './dist',
|
||||||
|
filename: 'js-openstack-lib.js',
|
||||||
|
library: 'JSOpenStackLib',
|
||||||
|
libraryTarget: 'umd'
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
loaders: [
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
loader: 'babel',
|
||||||
|
exclude: /node_modules/
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
Reference in New Issue
Block a user