Skip to content

Commit

Permalink
feat(bundles): Use regular ui-router style: _bundles lib and lib-esm …
Browse files Browse the repository at this point in the history
…dirs

BREAKING CHANGE: Moved bundles to _bundles and renamed bundle.  Stopped committing bundles directory to git tags
  • Loading branch information
christopherthielen committed Oct 22, 2017
1 parent 1ac31f0 commit d68ce15
Show file tree
Hide file tree
Showing 5 changed files with 624 additions and 34 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
lib
lib-esm
build
bundles
_bundles
node_modules
.npm
.node_repl_history
Expand Down
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"version": "4.0.2",
"scripts": {
"start": "webpack-dev-server --port 4039 --content-base example",
"clean": "shx rm -rf lib bundles",
"compile": "tsc",
"clean": "shx rm -rf lib lib-esm _bundles",
"compile": "tsc && tsc -m es6 --outdir lib-esm",
"bundle": "webpack",
"build": "npm run clean && npm run compile && npm run bundle",
"install": "node ./migrate/migratewarn.js",
"prepublish": "npm run build",
"release": "./release.sh"
"prepublishOnly": "npm run build",
"release": "release"
},
"homepage": "http://ui-router.github.com/visualizer",
"contributors": [
Expand Down Expand Up @@ -42,13 +42,14 @@
"@types/d3-hierarchy": "^1.0.4",
"@types/d3-interpolate": "^1.1.6",
"@uirouter/core": ">=5.0.0",
"@uirouter/publish-scripts": "^2.0.5",
"css-loader": "^0.28.7",
"es6-shim": "^0.35.0",
"file-loader": "^0.11.2",
"font-awesome-svg-png": "^1.2.2",
"fork-ts-checker-webpack-plugin": "^0.2.8",
"shx": "^0.2.2",
"style-loader": "^0.18.2",
"style-loader": "0.19.0",
"ts-loader": "^2.3.6",
"typescript": "^2.5.2",
"url-loader": "^0.5.9",
Expand All @@ -58,6 +59,7 @@
"peerDependencies": {
"@uirouter/core": ">=5.0.0"
},
"main": "bundles/visualizer.min.js",
"typings": "lib/visualizer.d.ts"
"main": "_bundles/ui-router-visualizer.js",
"jsnext:main": "lib-esm/visualizer.js",
"typings": "lib-esm/visualizer.d.ts"
}
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"moduleResolution": "node",

"files": [
"src/visualizer.ts", "src/svg.d.ts"
],
Expand All @@ -11,12 +9,14 @@
"lib": ["es6", "dom"],
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"rootDir": "src",
"sourceRoot": "src",
"moduleResolution": "node",
"module": "commonjs",
"target": "es5",
"outDir": "lib",
"declaration": true,
"sourceMap": true
}
}

21 changes: 15 additions & 6 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
var webpack = require('webpack');
var path = require('path');
var ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

module.exports = {
context: __dirname,
entry: "./src/visualizer.ts",
entry: {
"ui-router-visualizer": ["./src/visualizer.ts"],
"ui-router-visualizer.min": ["./src/visualizer.ts"]
},

output: {
path: __dirname + "/bundles",
publicPath: "/bundles/",
filename: "visualizer.min.js",
path: path.resolve(__dirname, "_bundles"),
publicPath: "/_bundles/",
filename: "[name].js",
libraryTarget: "umd",
library: "ui-router-visualizer",
umdNamedDefine: true
Expand All @@ -20,7 +25,12 @@ module.exports = {
plugins: [
new ForkTsCheckerWebpackPlugin(),

new webpack.optimize.UglifyJsPlugin({ sourceMap: true, compress: { warnings: false } }),
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
minify: true,
sourceMap: true,
compress: { warnings: false },
}),

new webpack.DefinePlugin({
'process.env': {
Expand All @@ -38,8 +48,7 @@ module.exports = {
{ test: /\.tsx?$/, loader: 'ts-loader', options: { transpileOnly: true } },
{ test: /\.css$/, loader: 'style-loader!css-loader?sourceMap-loader' },
// inline base64 URLs for <=8k images, direct URLs for the rest
{ test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192' }

{ test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192' },
]
},

Expand Down
Loading

0 comments on commit d68ce15

Please sign in to comment.