Skip to content
This repository was archived by the owner on Aug 5, 2020. It is now read-only.

Commit d7967b6

Browse files
committedJan 11, 2016
Improve deployment
1 parent 458fd51 commit d7967b6

5 files changed

+63
-44
lines changed
 

‎package.json

+13-5
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,21 @@
33
"version": "1.0.0-alpha",
44
"description": "Visualize your app state with a range of reusable charts",
55
"main": "lib/index.js",
6+
"files": [
7+
"dist",
8+
"lib",
9+
"src"
10+
],
611
"scripts": {
712
"clean": "rimraf lib dist",
8-
"build": "babel src --out-dir lib",
9-
"build:umd": "webpack src/index.js dist/d3-state-visualizer.js && NODE_ENV=production webpack src/index.js dist/d3-state-visualizer.min.js",
1013
"lint": "eslint src examples",
11-
"prepublish": "npm run lint && npm run clean && npm run build && npm run build:umd"
14+
"build": "npm run build:lib && npm run build:umd && npm run build:umd:min",
15+
"build:lib": "babel src --out-dir lib",
16+
"build:umd": "webpack src/index.js dist/d3-state-visualizer.js --config webpack.config.development.js",
17+
"build:umd:min": "webpack src/index.js dist/d3-state-visualizer.min.js --config webpack.config.production.js",
18+
"version": "npm run build",
19+
"postversion": "git push && git push --tags && npm run clean",
20+
"prepublish": "npm run clean && npm run build"
1221
},
1322
"repository": {
1423
"type": "git",
@@ -39,8 +48,7 @@
3948
"eslint-config-airbnb": "0.0.6",
4049
"eslint-plugin-react": "^3.6.3",
4150
"rimraf": "^2.3.4",
42-
"webpack": "^1.9.6",
43-
"webpack-dev-server": "^1.8.2"
51+
"webpack": "^1.9.6"
4452
},
4553
"peerDependencies": {},
4654
"dependencies": {

‎webpack.config.base.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'use strict';
2+
3+
module.exports = {
4+
module: {
5+
loaders: [
6+
{ test: /\.js$/, loaders: ['babel-loader'], exclude: /node_modules/ }
7+
]
8+
},
9+
output: {
10+
library: 'd3-state-visualizer',
11+
libraryTarget: 'umd'
12+
},
13+
resolve: {
14+
extensions: ['', '.js']
15+
}
16+
};

‎webpack.config.development.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
3+
var webpack = require('webpack');
4+
var baseConfig = require('./webpack.config.base');
5+
6+
var config = Object.create(baseConfig);
7+
config.plugins = [
8+
new webpack.optimize.OccurenceOrderPlugin(),
9+
new webpack.DefinePlugin({
10+
'process.env.NODE_ENV': JSON.stringify('development')
11+
})
12+
];
13+
14+
module.exports = config;

‎webpack.config.js

-39
This file was deleted.

‎webpack.config.production.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'use strict';
2+
3+
var webpack = require('webpack');
4+
var baseConfig = require('./webpack.config.base');
5+
6+
var config = Object.create(baseConfig);
7+
config.plugins = [
8+
new webpack.optimize.OccurenceOrderPlugin(),
9+
new webpack.DefinePlugin({
10+
'process.env.NODE_ENV': JSON.stringify('production')
11+
}),
12+
new webpack.optimize.UglifyJsPlugin({
13+
compressor: {
14+
screw_ie8: true,
15+
warnings: false
16+
}
17+
})
18+
];
19+
20+
module.exports = config;

0 commit comments

Comments
 (0)