Commit d8503e26 authored by Afaq Tariq's avatar Afaq Tariq
Browse files

removed webpack config and deps. gulp all the way

parent 7d06334f
This source diff could not be displayed because it is too large. You can view the blob instead.
var g = require('gulp')
var del = require('del')
var concat = require('gulp-concat')
var uglify = require('gulp-uglify')
var cssmin = require('gulp-cssmin')
......@@ -7,21 +6,7 @@ var gutil = require('gulp-util')
var ngAnnotate = require('gulp-ng-annotate')
var templateCache = require('gulp-angular-templatecache')
/**
* concat all js
* minify concated js
* cache angular templates
* ==> linuxDash.min.js
*
* css minified
* ===> linuxDash.min.css
*/
g.task('delete-existing-js-dist', function () {
return del([ 'app/linuxDash.min.js' ])
})
g.task('generate-template-cache', function () {
g.task('template-cache', function () {
return g.src('src/**/*.html')
.pipe(templateCache('templates.js', {
module: 'linuxDash',
......@@ -31,23 +16,19 @@ g.task('generate-template-cache', function () {
.pipe(g.dest('temp/'))
})
g.task('generate-js-dist', [
'delete-existing-js-dist',
'generate-template-cache'
],
function () {
return g.src([
'node_modules/angular/angular.min.js',
'node_modules/angular-route/angular-route.min.js',
'node_modules/smoothie/smoothie.js',
'src/js/**/*.js',
'temp/templates.js'
])
.pipe(ngAnnotate())
.pipe(uglify())
.on('error', gutil.log)
.pipe(concat('linuxDash.min.js'))
.pipe(g.dest('app/'))
g.task('generate-js-dist', ['template-cache'], function () {
return g.src([
'node_modules/angular/angular.min.js',
'node_modules/angular-route/angular-route.min.js',
'node_modules/smoothie/smoothie.js',
'src/js/**/*.js',
'temp/templates.js'
])
.pipe(concat('linuxDash.min.js'))
.pipe(ngAnnotate())
.pipe(uglify())
.on('error', gutil.log)
.pipe(g.dest('app/'))
})
g.task('generate-css-dist', function () {
......
......@@ -30,10 +30,6 @@
"devDependencies": {
"angular": "1.3.4",
"angular-route": "1.3.4",
"babel-core": "^6.9.0",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.9.0",
"css-loader": "^0.23.1",
"del": "^2.2.0",
"gulp": "^3.9.1",
"gulp-angular-templatecache": "^1.8.0",
......@@ -42,9 +38,6 @@
"gulp-ng-annotate": "^2.0.0",
"gulp-uglify": "^1.5.3",
"gulp-util": "^3.0.7",
"ng-annotate-webpack-plugin": "^0.1.2",
"smoothie": "^1.27.0",
"style-loader": "^0.13.1",
"webpack": "^1.13.1"
}
}
const webpack = require('webpack')
const ngAnnotatePlugin = require('ng-annotate-webpack-plugin')
module.exports = {
entry: "./src/js/index.js",
output: {
library: 'linuxDash',
filename: 'linuxDash.min.js',
path: './app',
},
module: {
loaders: [
{
test: /\.css$/,
loader: "style-loader!css-loader"
},
{
loader: 'babel',
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
query: {
presets: ['es2015']
}
}
]
},
plugins: [
new ngAnnotatePlugin({
add: true,
}),
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false },
}),
new webpack.optimize.DedupePlugin()
]
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment