Skip to content

Commit

Permalink
add umd wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
KillerCodeMonkey committed Jun 11, 2016
1 parent cf5da6a commit 6129e96
Show file tree
Hide file tree
Showing 5 changed files with 454 additions and 442 deletions.
18 changes: 16 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,27 @@ module.exports = function (grunt) {
uglify: {
my_target: {
files: {
"src/ng-quill.min.js": "src/ng-quill.js"
"src/ng-quill.min.js": "src/ng-quill.min.js"
}
}
},
umd: {
all: {
options: {
src: 'src/ng-quill.js',
dest: 'src/ng-quill.min.js', // optional, if missing the src will be used
deps: { // optional, `default` is used as a fallback for rest!
'default': ['Quill', 'angular'],
amd: ['Quill', 'angular'],
cjs: ['Quill', 'angular']
}
}
}
}
});

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-umd');

grunt.registerTask('default', ['uglify']);
grunt.registerTask('default', ['umd', 'uglify']);
};
2 changes: 1 addition & 1 deletion demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!-- Scripts -->
<script type="text/javascript" src="//code.angularjs.org/1.5.6/angular.min.js"></script>
<script type="text/javascript" src="//cdn.quilljs.com/0.20.1/quill.js"></script>
<script type="text/javascript" src="src/ng-quill.js"></script>
<script type="text/javascript" src="src/ng-quill.min.js"></script>
<script>
// declare a module and load quillModule
var myAppModule = angular.module('quillTest', ['ngQuill']);
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"main": "src/ng-quill.min.js",
"devDependencies": {
"grunt": "~0.4.3",
"grunt-contrib-uglify": "~0.6.0"
"grunt-contrib-uglify": "~0.6.0",
"grunt-umd": "~2.3.6"
},
"engines": {
"node": ">=0.10"
Expand Down
Loading

0 comments on commit 6129e96

Please sign in to comment.