diff --git a/examples/html-loader/webpack.config.js b/examples/html-loader/webpack.config.js index e31a36a..b34b7a1 100755 --- a/examples/html-loader/webpack.config.js +++ b/examples/html-loader/webpack.config.js @@ -10,14 +10,15 @@ module.exports = { module: { loaders: [ { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }, - { test: /\.png$/, loader: 'file-loader' } + { test: /\.png$/, loader: 'file-loader' }, + { test: /\.html$/, loader: 'html-loader' }, ] }, plugins: [ new HtmlWebpackPlugin({ filename: 'html-loader.html', favicon: 'favicon.ico', - template: 'html!./template.html' + template: 'template.html' }), new ExtractTextPlugin('styles.css') ] diff --git a/examples/javascript/example.js b/examples/javascript/example.js new file mode 100644 index 0000000..8b8f606 --- /dev/null +++ b/examples/javascript/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/javascript/logo.png b/examples/javascript/logo.png new file mode 100644 index 0000000..d71b3d7 Binary files /dev/null and b/examples/javascript/logo.png differ diff --git a/examples/javascript/main.css b/examples/javascript/main.css new file mode 100644 index 0000000..232a2cd --- /dev/null +++ b/examples/javascript/main.css @@ -0,0 +1,3 @@ +body { + background: snow; +} \ No newline at end of file diff --git a/examples/javascript/partial.html b/examples/javascript/partial.html new file mode 100644 index 0000000..47dc0f7 --- /dev/null +++ b/examples/javascript/partial.html @@ -0,0 +1,2 @@ +
\ No newline at end of file
diff --git a/examples/javascript/template.js b/examples/javascript/template.js
new file mode 100644
index 0000000..0dbe82a
--- /dev/null
+++ b/examples/javascript/template.js
@@ -0,0 +1,5 @@
+// Webpack require:
+var partial = require('./partial.html');
+
+// Export a function / promise / or a string:
+module.exports = '' + new Date() + partial + '';
diff --git a/examples/javascript/webpack.config.js b/examples/javascript/webpack.config.js
new file mode 100644
index 0000000..8df7eec
--- /dev/null
+++ b/examples/javascript/webpack.config.js
@@ -0,0 +1,23 @@
+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' }
+ ]
+ },
+ plugins: [
+ new HtmlWebpackPlugin({
+ template: 'template.js'
+ }),
+ new ExtractTextPlugin('styles.css')
+ ]
+};
\ No newline at end of file
diff --git a/examples/two-loaders/two-loaders/example.js b/examples/two-loaders/two-loaders/example.js
new file mode 100644
index 0000000..13a1ca1
--- /dev/null
+++ b/examples/two-loaders/two-loaders/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/two-loaders/two-loaders/logo.png b/examples/two-loaders/two-loaders/logo.png
new file mode 100644
index 0000000..d71b3d7
Binary files /dev/null and b/examples/two-loaders/two-loaders/logo.png differ
diff --git a/examples/two-loaders/two-loaders/main.css b/examples/two-loaders/two-loaders/main.css
new file mode 100644
index 0000000..232a2cd
--- /dev/null
+++ b/examples/two-loaders/two-loaders/main.css
@@ -0,0 +1,3 @@
+body {
+ background: snow;
+}
\ No newline at end of file
diff --git a/examples/two-loaders/two-loaders/partial.html b/examples/two-loaders/two-loaders/partial.html
new file mode 100644
index 0000000..47dc0f7
--- /dev/null
+++ b/examples/two-loaders/two-loaders/partial.html
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/examples/two-loaders/two-loaders/template.html b/examples/two-loaders/two-loaders/template.html
new file mode 100644
index 0000000..edb44d6
--- /dev/null
+++ b/examples/two-loaders/two-loaders/template.html
@@ -0,0 +1,11 @@
+
+
+
+
+