Replaced gulp with webpack

This commit is contained in:
Walter Barbagallo 2017-03-10 12:41:10 +01:00
parent 4059b10124
commit 6dc81ec078
3 changed files with 9 additions and 19 deletions

View File

@ -1,15 +0,0 @@
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var rename = require("gulp-rename");
gulp.task('compress', function() {
return gulp.src('codice.fiscale.js')
.pipe(uglify())
.pipe(rename('codice.fiscale.min.js'))
.pipe(gulp.dest('.'));
});
gulp.task('default', ['compress'], function() {
// place code for your default task here
});

View File

@ -8,14 +8,14 @@
}, },
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"gulp-rename": "^1.2.2",
"gulp-uglify": "^1.5.3",
"jasmine-core": "^2.4.1", "jasmine-core": "^2.4.1",
"karma": "^0.13.22", "karma": "^0.13.22",
"karma-chrome-launcher": "^0.2.2", "karma-chrome-launcher": "^0.2.2",
"karma-jasmine": "^0.3.7", "karma-jasmine": "^0.3.7",
"karma-phantomjs-launcher": "^1.0.0", "karma-phantomjs-launcher": "^1.0.0",
"phantomjs-prebuilt": "^2.1.5", "phantomjs-prebuilt": "^2.1.5",
"uglify-js": "^2.8.11",
"uglifyjs-webpack-plugin": "^0.3.0",
"webpack": "^2.2.1" "webpack": "^2.2.1"
}, },
"scripts": { "scripts": {

View File

@ -1,4 +1,6 @@
const path = require('path'); const path = require('path'),
UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = { module.exports = {
entry: { entry: {
@ -9,5 +11,8 @@ module.exports = {
libraryTarget: 'window', libraryTarget: 'window',
filename: '[name].js', filename: '[name].js',
path: path.resolve(__dirname, 'dist') path: path.resolve(__dirname, 'dist')
} },
plugins: [
new UglifyJSPlugin()
]
}; };