Skip to content

Commit 020ab03

Browse files
committed
Added webpack and babel to node modules + added initial task
1 parent e08edc3 commit 020ab03

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
22
"private": true,
33
"devDependencies": {
4-
"gulp": "^3.8.8"
4+
"babel-core": "^6.4.5",
5+
"babel-loader": "^6.2.1",
6+
"babel-preset-es2015": "^6.3.13",
7+
"gulp": "^3.8.8",
8+
"webpack": "^1.12.11",
9+
"webpack-dev-server": "^1.14.1"
510
},
611
"dependencies": {
712
"eslint": "^1.10.3",

tasks/angular.task.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var uglify = require('gulp-uglify');
99
var ngAnnotate = require('gulp-ng-annotate');
1010
var notify = require('gulp-notify');
1111
var gulpif = require('gulp-if');
12+
var webpack = require('webpack-stream');
1213

1314
var Elixir = require('laravel-elixir');
1415

@@ -24,7 +25,8 @@ Elixir.extend('angular', function(src, output, outputFilename) {
2425
.pipe(eslint())
2526
.pipe(eslint.format())
2627
.pipe(gulpif(! config.production, sourcemaps.init()))
27-
.pipe(concat(outputFilename || 'app.js'))
28+
.pipe(webpack(require('../webpack.config.js')))
29+
// .pipe(concat(outputFilename || 'app.js'))
2830
.pipe(ngAnnotate())
2931
.pipe(gulpif(config.production, uglify()))
3032
.pipe(gulpif(! config.production, sourcemaps.write()))

webpack.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
// configuration
3+
entry: "index.main.js",
4+
output: {
5+
filename: "app.js"
6+
},
7+
module: {
8+
loaders: [{
9+
test: /\.js?$/,
10+
exclude: /(node_modules|bower_components)/,
11+
loader: 'babel', // 'babel-loader' is also a legal name to reference
12+
query: {
13+
presets: ['es2015'],
14+
cacheDirectory: true
15+
}
16+
}]
17+
}
18+
};

0 commit comments

Comments
 (0)