diff --git a/examples/appcache/example.js b/examples/appcache/example.js new file mode 100755 index 0000000..13a1ca1 --- /dev/null +++ b/examples/appcache/example.js @@ -0,0 +1,4 @@ +require('./main.css'); +var h1 = document.createElement('h1'); +h1.innerHTML = 'Hello world!'; +document.body.appendChild(h1); \ No newline at end of file diff --git a/examples/appcache/logo.png b/examples/appcache/logo.png new file mode 100644 index 0000000..d71b3d7 Binary files /dev/null and b/examples/appcache/logo.png differ diff --git a/examples/appcache/main.css b/examples/appcache/main.css new file mode 100644 index 0000000..232a2cd --- /dev/null +++ b/examples/appcache/main.css @@ -0,0 +1,3 @@ +body { + background: snow; +} \ No newline at end of file diff --git a/examples/appcache/template.html b/examples/appcache/template.html new file mode 100644 index 0000000..b7b4f97 --- /dev/null +++ b/examples/appcache/template.html @@ -0,0 +1,11 @@ + + +
+ +
+
+
\ No newline at end of file
diff --git a/examples/appcache/webpack.config.js b/examples/appcache/webpack.config.js
new file mode 100755
index 0000000..61163dc
--- /dev/null
+++ b/examples/appcache/webpack.config.js
@@ -0,0 +1,30 @@
+var AppCachePlugin = require('appcache-webpack-plugin');
+var HtmlWebpackPlugin = require('../..');
+var ExtractTextPlugin = require('extract-text-webpack-plugin');
+module.exports = {
+ entry: './example.js',
+ output: {
+ path: __dirname + '/dist',
+ publicPath: '',
+ filename: 'bundle.js'
+ },
+ module: {
+ loaders: [
+ { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') },
+ { test: /\.png$/, loader: 'file-loader' },
+ { test: /\.html$/, loader: 'html-loader?-removeOptionalTags' },
+ ]
+ },
+ plugins: [
+ new AppCachePlugin(),
+ new HtmlWebpackPlugin({
+ filename: 'index.html',
+ template: 'template.html',
+ minify:{
+ removeComments:true,
+ collapseWhitespace:true
+ }
+ }),
+ new ExtractTextPlugin('styles.css')
+ ]
+};
\ No newline at end of file