1 | module.exports = function(grunt) { |
||
2 | |||
3 | // Project configuration. |
||
4 | grunt.initConfig({ |
||
0 ignored issues
–
show
|
|||
5 | pkg: grunt.file.readJSON('package.json'), |
||
6 | 'concat': { |
||
7 | options: { |
||
8 | // define a string to put between each file in the concatenated output |
||
9 | separator: ';' |
||
10 | }, |
||
11 | dist: { |
||
12 | // the files to concatenate |
||
13 | src: [ |
||
14 | 'src/Compatibility.js', |
||
15 | 'src/PrototypeBuilder.js', |
||
16 | 'src/ClassBuilder.js', |
||
17 | 'src/InterfaceBuilder.js', |
||
18 | 'src/EnumBuilder.js', |
||
19 | 'src/Reflection.js', |
||
20 | 'src/Config.js', |
||
21 | 'src/joii.js' |
||
22 | ], |
||
23 | // the location of the resulting JS file |
||
24 | dest: './dist/<%= pkg.name %>.js' |
||
25 | } |
||
26 | }, |
||
27 | 'uglify': { |
||
28 | options: { |
||
29 | banner: '/* <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' |
||
30 | }, |
||
31 | build: { |
||
32 | src: './dist/<%= pkg.name %>.js', |
||
33 | dest: './dist/<%= pkg.name %>.min.js' |
||
34 | } |
||
35 | } |
||
36 | }); |
||
37 | |||
38 | grunt.loadNpmTasks('grunt-contrib-concat'); |
||
39 | grunt.loadNpmTasks('grunt-contrib-uglify'); |
||
40 | |||
41 | grunt.registerTask('default', ['concat', 'uglify']); |
||
42 | }; |
||
43 |
Strict mode is a way to opt-in to a restricted variant of JavaScript. It eliminates some common pitfalls by being less lenient and raising more errors.
Besides, it is also used to fix certain mistakes which made it difficult for JavaScript runtimes to perform certain optimizations.
We generally recommend to only enable strict mode on the function scope and not in the global scope as that might break third-party scripts on your website.