Skip to content

Commit

Permalink
Stop publishing all-in-one bundle. There's a CDN for that
Browse files Browse the repository at this point in the history
  • Loading branch information
cburgmer committed Oct 30, 2016
1 parent 7b17b61 commit 2571b79
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 64 deletions.
79 changes: 16 additions & 63 deletions Gruntfile.js
Expand Up @@ -9,6 +9,7 @@ module.exports = function (grunt) {
files: [
// http://stackoverflow.com/questions/29391111/karma-phantomjs-and-es6-promises
'node_modules/babel-polyfill/dist/polyfill.js',
'build/dependencies/dependencies.js',
'build/testSuite.js',
{pattern: 'test/fixtures/**', included: false}
],
Expand All @@ -34,12 +35,17 @@ module.exports = function (grunt) {
},
browserify: {
xmlserializer: {
src: 'node_modules/xmlserializer/lib/serializer.js',
src: [],
dest: 'build/dependencies/xmlserializer.js',
options: {
browserifyOptions: {
standalone: 'xmlserializer'
}
require: ['xmlserializer']
}
},
dependencies: {
src: [],
dest: 'build/dependencies/dependencies.js',
options: {
require: ['url', 'css-font-face-src', 'cssom']
}
},
testSuite: {
Expand All @@ -48,7 +54,8 @@ module.exports = function (grunt) {
options: {
browserifyOptions: {
debug: true
}
},
external: ['cssom', 'url', 'css-font-face-src']
}
},
browser: {
Expand All @@ -58,26 +65,7 @@ module.exports = function (grunt) {
browserifyOptions: {
standalone: '<%= pkg.name %>',
},
external: ['cssom', 'url']
}
},
allinone: {
src: 'src/inline.js',
dest: 'build/<%= pkg.name %>.allinone.js',
options: {
browserifyOptions: {
standalone: '<%= pkg.name %>'
}
}
},
allinoneNoCssom: {
src: 'src/inline.js',
dest: 'build/<%= pkg.name %>.allinone.nocssom.js',
options: {
browserifyOptions: {
standalone: '<%= pkg.name %>'
},
exclude: ['cssom']
external: ['cssom', 'url', 'css-font-face-src']
}
}
},
Expand All @@ -98,39 +86,6 @@ module.exports = function (grunt) {
dest: 'dist/<%= pkg.name %>.js'
}
},
uglify: {
allinone: {
options: {
banner:'/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* <%= pkg.homepage %>\n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= pkg.license %> */\n' +
'/* Integrated dependencies:\n' +
' * url (MIT License),\n' +
' * CSSOM.js (MIT License),\n' +
' * css-font-face-src (BSD License) */\n'
},
files: {
'dist/<%= pkg.name %>.allinone.js': ['build/<%= pkg.name %>.allinone.js']
}
},
allinoneNoCssom: {
options: {
banner:'/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* <%= pkg.homepage %>\n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= pkg.license %> */\n' +
'/* Integrated dependencies:\n' +
' * url (MIT License),\n' +
' * css-font-face-src (BSD License) */\n'
},
files: {
'dist/<%= pkg.name %>.allinone.nocssom.js': ['build/<%= pkg.name %>.allinone.nocssom.js']
}
}
},
watch: {
karma: {
files: [
Expand Down Expand Up @@ -226,7 +181,8 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-karma');

grunt.registerTask('testDeps', [
'browserify:xmlserializer'
'browserify:xmlserializer',
'browserify:dependencies'
]);

grunt.registerTask('testWatch', [
Expand All @@ -243,10 +199,7 @@ module.exports = function (grunt) {

grunt.registerTask('build', [
'browserify:browser',
'concat:dist',
'browserify:allinone',
'browserify:allinoneNoCssom',
'uglify'
'concat:dist'
]);

grunt.registerTask('default', [
Expand Down
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -10,6 +10,15 @@ Inlines style sheets, images, fonts and scripts in HTML documents. Works in the

See the [API](https://github.com/cburgmer/inlineresources/wiki/API).

Install
-------

$ npm install inlineresources

and require through browserify or webpack.

Alternatively use a standalone bundle via e.g. https://wzrd.in/standalone/inlineresources@latest.

Limitations
-----------

Expand Down
4 changes: 3 additions & 1 deletion examples/bundlePage.html
Expand Up @@ -4,8 +4,10 @@
<title>Helper page for bundlePage.js</title>
<script type="text/javascript" src="../node_modules/babel-polyfill/dist/polyfill.js"></script>
<script type="text/javascript" src="../build/dependencies/xmlserializer.js"></script>
<script type="text/javascript" src="../dist/inlineresources.allinone.js"></script>
<script type="text/javascript" src="../build/dependencies/dependencies.js"></script>
<script type="text/javascript" src="../dist/inlineresources.js"></script>
<script>
var xmlserializer = require('xmlserializer');
var sendMessage = function (cmd, content) {
console.log(JSON.stringify({
cmd: cmd,
Expand Down

0 comments on commit 2571b79

Please sign in to comment.