Last active
June 13, 2019 11:37
-
-
Save pyrsmk/0a47a460b8fb262fee4069e67c16d5b5 to your computer and use it in GitHub Desktop.
Systèmes de build : Grunt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const typescript = require('rollup-plugin-typescript2') | |
const prepack = require('rollup-plugin-prepack-up') | |
module.exports = grunt => { | |
grunt.loadNpmTasks('grunt-eslint') | |
grunt.loadNpmTasks('grunt-rollup') | |
grunt.loadNpmTasks('grunt-contrib-uglify') | |
grunt.initConfig({ | |
eslint: { | |
target: ['src/*.ts'], | |
}, | |
rollup: { | |
files: { | |
src: ['src/Toast.ts'], | |
dest: 'dist/toast.js', | |
}, | |
options: { | |
format: 'umd', | |
name: 'toast', | |
plugins: [ | |
typescript(), | |
prepack(), | |
], | |
}, | |
}, | |
uglify: { | |
prod: { | |
src: ['dist/toast.js'], | |
dest: 'dist/toast.min.js', | |
}, | |
dev: { | |
src: ['dist/toast.js'], | |
dest: 'tests/lib/toast.min.js', | |
options: { | |
sourceMap: { | |
url: 'inline', | |
filename: 'toast.js', | |
}, | |
}, | |
}, | |
}, | |
}) | |
grunt.registerTask('default', ['eslint', 'rollup', 'uglify:prod', 'uglify:dev']) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment