Skip to content

Commit 5c3067f

Browse files
committed
Experimental testing with material 2
1 parent 171580e commit 5c3067f

File tree

5 files changed

+60
-23
lines changed

5 files changed

+60
-23
lines changed

addon/ng2/models/dist/dll/dll.polyfills.js

-1
This file was deleted.

addon/ng2/models/dist/dll/dll.vendor.js

-1
This file was deleted.

addon/ng2/models/webpack-build-common.ts

+58-20
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,30 @@ const path = require('path');
55
const ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin;
66
const CopyWebpackPlugin = require('copy-webpack-plugin');
77
const HtmlWebpackPlugin = require('html-webpack-plugin');
8+
const DebugWebpackPlugin = require('debug-webpack-plugin');
89

910
export const webpackCommonConfig = {
1011
devtool: 'inline-source-map',
1112
resolve: {
1213
extensions: ['', '.ts', '.js'],
13-
root: ngAppResolve('./src')
14+
//SAVE: TODO# Don't use relative bp
15+
root: ngAppResolve('/src/demo-app'),
16+
alias: {
17+
"@angular2-material/core": ngAppResolve('./src/core'),
18+
"@angular2-material": ngAppResolve('./src/components')
19+
}
1420
},
21+
debug: true,
1522
context: path.resolve(__dirname, './'),
23+
//SAVE entry: {
24+
// main: [ngAppResolve('./src/main.ts')],
25+
// vendor: ngAppResolve('./src/vendor.ts'),
26+
// polyfills: ngAppResolve('./src/polyfills.ts')
27+
// },
1628
entry: {
17-
main: [ngAppResolve('./src/main.ts')],
18-
vendor: ngAppResolve('./src/vendor.ts'),
19-
polyfills: ngAppResolve('./src/polyfills.ts')
29+
main: [ngAppResolve('./src/demo-app/main.ts')],
30+
// core: ngAppResolve('./src/core/core.ts'),
31+
// main: ngAppResolve('./src/e2e-app/main.ts')
2032
},
2133
output: {
2234
path: ngAppResolve('./dist'),
@@ -40,12 +52,13 @@ export const webpackCommonConfig = {
4052
{
4153
loader: 'awesome-typescript-loader',
4254
query: {
43-
useWebpackText: true,
44-
tsconfig: ngAppResolve('./src/tsconfig.json'),
45-
resolveGlobs: false,
55+
// useWebpackText: true,
56+
tsconfig: ngAppResolve('./src/demo-app/tsconfig.json'),
57+
// SAVE tsconfig: ngAppResolve('./src/tsconfig.json'),
58+
// resolveGlobs: false,
4659
module: "es2015",
4760
target: "es5",
48-
library: 'es6',
61+
// library: 'es6',
4962
useForkChecker: true
5063
}
5164
},
@@ -65,21 +78,46 @@ export const webpackCommonConfig = {
6578
]
6679
},
6780
plugins: [
81+
new CopyWebpackPlugin([
82+
{from: ngAppResolve('./src/core'), to: ngAppResolve('./dist/core')}
83+
{from: ngAppResolve('./src/components'), to: ngAppResolve('./dist/components')}
84+
]),
85+
new DebugWebpackPlugin({
86+
// Defaults to ['webpack:*'] which can be VERY noisy, so try to be specific
87+
// scope: [
88+
// 'webpack:compiler:*', // include compiler logs
89+
// 'webpack:plugin:ExamplePlugin' // include a specific plugin's logs
90+
// ],
91+
92+
// // Inspect the arguments passed to an event
93+
// // These are triggered on emits
94+
// listeners: {
95+
// 'webpack:compiler:run': function(compiler) {
96+
// // Read some data out of the compiler
97+
// }
98+
// },
99+
// Defaults to the compiler's setting
100+
debug: true;
101+
})
68102
new ForkCheckerPlugin(),
103+
//SAVE new HtmlWebpackPlugin({
104+
// template: ngAppResolve('src/index.html'),
105+
// chunksSortMode: 'dependency'
106+
// }),
69107
new HtmlWebpackPlugin({
70-
template: ngAppResolve('src/index.html'),
71-
chunksSortMode: 'dependency'
72-
}),
73-
new webpack.optimize.CommonsChunkPlugin({
74-
name: ['polyfills', 'vendor'].reverse()
75-
}),
76-
new webpack.optimize.CommonsChunkPlugin({
77-
minChunks: Infinity,
78-
name: 'inline',
79-
filename: 'inline.js',
80-
sourceMapFilename: 'inline.map'
108+
template: ngAppResolve('./src/demo-app/index.html'),
81109
}),
82-
new CopyWebpackPlugin([{from: ngAppResolve('./public'), to: ngAppResolve('./dist/public')}])
110+
// new webpack.optimize.CommonsChunkPlugin('core'),
111+
//SAVE new webpack.optimize.CommonsChunkPlugin({
112+
// name: ['polyfills', 'vendor'].reverse()
113+
// }),
114+
// new webpack.optimize.CommonsChunkPlugin({
115+
// minChunks: Infinity,
116+
// name: 'inline',
117+
// filename: 'inline.js',
118+
// sourceMapFilename: 'inline.map'
119+
// })
120+
// new CopyWebpackPlugin([{from: ngAppResolve('./public'), to: ngAppResolve('./dist/public')}])
83121
],
84122
node: {
85123
global: 'window',

addon/ng2/models/webpack-build-production.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const webpackProdConfig = webpackMerge(webpackCommonConfig, {
4343
tslint: {
4444
emitErrors: true,
4545
failOnHint: true,
46-
resourcePath: ngAppResolve('./src')
46+
resourcePath: ngAppResolve('./src/demo-app')
4747
},
4848
htmlLoader: {
4949
minimize: true,

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"copy-webpack-plugin": "^3.0.1",
4343
"core-js": "^2.4.0",
4444
"css-loader": "^0.23.1",
45+
"debug-webpack-plugin": "^0.1.0",
4546
"ember-cli": "2.5.0",
4647
"ember-cli-string-utils": "^1.0.0",
4748
"exit": "^0.1.2",

0 commit comments

Comments
 (0)