Skip to content

Commit 3a1160d

Browse files
chore(build): fix packaging stateEvents.js into ng1-bower and ng1
closes #2655
1 parent b8412da commit 3a1160d

File tree

8 files changed

+67
-3
lines changed

8 files changed

+67
-3
lines changed
File renamed without changes.

packages/ng1-bower/gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**/tsconfig.json
2+
**/webpack.config.js
3+
**/node_modules
4+
**/ng2*
5+
commonjs
6+
typings
7+
.*

packages/ng1-bower/tsconfig.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"compilerOptions": { "rootDir": ".", "outDir": "../commonjs" },
3+
"files": [
4+
"ng1.ts",
5+
"ng1/stateEvents.ts",
6+
"../typings/es6-shim/es6-shim.d.ts" ,
7+
"../typings/angularjs/angular.d.ts"
8+
]
9+
}

packages/ng1-bower/webpack.config.js

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// <package>/../../src/ is copied to <package>/src
2+
// This config is then copied to <package>/src/webpack.config.js
3+
4+
var pkg = require('../bower.json');
5+
var banner = pkg.description + '\n' +
6+
'@version v' + pkg.version + '\n' +
7+
'@link ' + pkg.homepage + '\n' +
8+
'@license MIT License, http://www.opensource.org/licenses/MIT';
9+
10+
var webpack = require('webpack');
11+
module.exports = {
12+
entry: {
13+
"angular-ui-router": "./ng1.ts",
14+
"angular-ui-router.min": "./ng1.ts",
15+
"stateEvents": "./ng1/stateEvents.ts",
16+
"stateEvents.min": "./ng1/stateEvents.ts"
17+
},
18+
19+
output: {
20+
path: __dirname + "/../release",
21+
filename: "[name].js",
22+
libraryTarget: "umd",
23+
library: "angular-ui-router",
24+
umdNamedDefine: true
25+
},
26+
27+
devtool: 'source-map',
28+
29+
resolve: {
30+
modulesDirectories: ['../../node_modules'],
31+
extensions: ['', '.js', '.ts']
32+
},
33+
34+
plugins: [
35+
new webpack.optimize.UglifyJsPlugin({
36+
include: /\.min\.js$/, minimize: true
37+
}),
38+
new webpack.BannerPlugin(banner)
39+
],
40+
41+
module: {
42+
loaders: [
43+
{ test: /\.ts$/, loader: "ts-loader" }
44+
]
45+
}
46+
};
File renamed without changes.

packages/ng1/webpack.config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ var webpack = require('webpack');
1111
module.exports = {
1212
entry: {
1313
"angular-ui-router": "./ng1.ts",
14-
"angular-ui-router.min": "./ng1.ts"
14+
"angular-ui-router.min": "./ng1.ts",
15+
"stateEvents": "./ng1/stateEvents.ts",
16+
"stateEvents.min": "./ng1/stateEvents.ts"
1517
},
1618

1719
output: {
File renamed without changes.

scripts/package.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ function prepPackage(pkgName) {
9999

100100
// Copy any of these files from the packages dir
101101
// Override any baseFiles with the copy from the package dir.
102-
let pkgFiles = ['.gitignore', '.npmignore'];
102+
let pkgFiles = ['gitignore', 'npmignore'];
103103
baseFiles.concat(pkgFiles).filter(file => test('-f', `${paths.pkgsrc}/${file}`))
104-
.forEach(file => cp(`${paths.pkgsrc}/${file}`, paths.build));
104+
.forEach(file => cp(`${paths.pkgsrc}/${file}`, `${paths.build}/.${file}`));
105105

106106
cp(files.webpack, paths.srcCopy);
107107

0 commit comments

Comments
 (0)