Skip to content

Commit c7ca12e

Browse files
committed
Now build commands actually rimraf the dist folder, and assets truly land in root path of dist instead of dist/public
1 parent 877d111 commit c7ca12e

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const path = require('path');
44
const ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin;
55
const CopyWebpackPlugin = require('copy-webpack-plugin');
66
const HtmlWebpackPlugin = require('html-webpack-plugin');
7-
const DebugWebpackPlugin = require('debug-webpack-plugin');
87

98
export const getWebpackCommonConfig = function(projectRoot: string) {
109
return {
@@ -76,7 +75,7 @@ export const getWebpackCommonConfig = function(projectRoot: string) {
7675
filename: 'inline.js',
7776
sourceMapFilename: 'inline.map'
7877
}),
79-
new CopyWebpackPlugin([{from: path.resolve(projectRoot, './public'), to: path.resolve(projectRoot, './dist/public')}])
78+
new CopyWebpackPlugin([{from: path.resolve(projectRoot, './public'), to: path.resolve(projectRoot, './dist')}])
8079
],
8180
node: {
8281
global: 'window',

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

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const path = require('path');
1313
const ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin;
1414
const CopyWebpackPlugin = require('copy-webpack-plugin');
1515
const HtmlWebpackPlugin = require('html-webpack-plugin');
16-
const DebugWebpackPlugin = require('debug-webpack-plugin');
1716

1817

1918
var components = [

addon/ng2/tasks/build-webpack-watch.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@ import {webpackOutputOptions} from '../models/';
33

44
import {ServeTaskOptions} from '../commands/serve';
55

6-
var Task = require('ember-cli/lib/models/task');
6+
var Task = require('ember-cli/lib/models/task');
77
const webpack = require('webpack');
88
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
9+
const rimraf = require('rimraf');
10+
const path = require('path');
911

1012
let lastHash: any = null;
1113

1214
module.exports = Task.extend({
1315
run: function(runTaskOptions: ServeTaskOptions) {
1416

1517
var project = this.cliProject;
18+
19+
rimraf.sync(path.resolve(project.root, runTaskOptions.outputPath));
20+
1621
const config = new NgCliWebpackConfig(project, runTaskOptions.environment).config;
1722
const webpackCompiler = webpack(config);
1823

addon/ng2/tasks/build-webpack.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import {webpackOutputOptions} from '../models/'
44

55
// Configure build and output;
66
var Task = require('ember-cli/lib/models/task');
7-
const webpack = require('webpack');
7+
const webpack = require('webpack');
8+
const rimraf = require('rimraf');
9+
const path = require('path');
810

911
let lastHash = null;
1012

@@ -13,6 +15,9 @@ module.exports = Task.extend({
1315
run: function(runTaskOptions: ServeTaskOptions) {
1416

1517
var project = this.cliProject;
18+
19+
rimraf.sync(path.resolve(project.root, runTaskOptions.outputPath));
20+
1621
var config = new NgCliWebpackConfig(project, runTaskOptions.environment).config;
1722
const webpackCompiler = webpack(config);
1823

package.json

+3-8
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,11 @@
3434
"@types/webpack": "^1.12.22-alpha",
3535
"angular2-template-loader": "^0.4.0",
3636
"awesome-typescript-loader": "1.1.1",
37-
"babel-core": "^6.9.1",
38-
"babel-loader": "^6.2.4",
39-
"babel-preset-es2015-webpack": "^6.4.1",
4037
"chalk": "^1.1.3",
4138
"compression-webpack-plugin": "^0.3.1",
4239
"copy-webpack-plugin": "^3.0.1",
4340
"core-js": "^2.4.0",
4441
"css-loader": "^0.23.1",
45-
"debug-webpack-plugin": "^0.1.0",
4642
"ember-cli": "2.5.0",
4743
"ember-cli-string-utils": "^1.0.0",
4844
"exit": "^0.1.2",
@@ -53,7 +49,6 @@
5349
"glob": "^7.0.3",
5450
"handlebars": "^4.0.5",
5551
"html-webpack-plugin": "^2.19.0",
56-
"http-server": "^0.9.0",
5752
"istanbul-instrumenter-loader": "^0.2.0",
5853
"json-loader": "^0.5.4",
5954
"karma": "^0.13.22",
@@ -69,8 +64,8 @@
6964
"less-loader": "^2.2.3",
7065
"lodash": "^4.11.1",
7166
"node-sass": "^3.7.0",
72-
"offline-plugin": "^3.4.1",
7367
"npm": "3.10.2",
68+
"offline-plugin": "^3.4.1",
7469
"opn": "4.0.1",
7570
"parse5": "^2.1.5",
7671
"phantomjs-polyfill": "0.0.2",
@@ -80,7 +75,7 @@
8075
"raw-loader": "^0.5.1",
8176
"remap-istanbul": "^0.6.4",
8277
"resolve": "^1.1.7",
83-
"rimraf": "^2.5.2",
78+
"rimraf": "^2.5.3",
8479
"sass-loader": "^3.2.0",
8580
"shelljs": "^0.7.0",
8681
"silent-error": "^1.0.0",
@@ -95,7 +90,7 @@
9590
"tslint": "^3.11.0",
9691
"tslint-loader": "^2.1.4",
9792
"typedoc": "^0.4.2",
98-
"typescript": "^1.9.0-dev.20160627-1.0",
93+
"typescript": "^2.0.0-dev.20160706",
9994
"typings": "^0.8.1",
10095
"url-loader": "^0.5.7",
10196
"webpack": "2.1.0-beta.15",

0 commit comments

Comments
 (0)