Skip to content

Instantly share code, notes, and snippets.

@jshcrowthe

jshcrowthe/index.html

Last active Sep 13, 2017
Embed
What would you like to do?
Demo consuming a module with Webpack
<html>
<head>
<script src="/main.js"></script>
</head>
</html>
import { logModule } from 'test-module';
logModule();
{
"name": "demo-consumer",
"version": "1.0.0",
"description": "A demo consumer",
"scripts": {
"start": "webpack-dev-server"
},
"devDependencies": {
"webpack": "^3.5.6",
"webpack-dev-server": "^2.8.0"
},
"dependencies": {
"test-module": "gist:acea97f8b18e81c0a797137b8a38f1e4"
}
}
const { resolve } = require('path');
module.exports = {
entry: resolve(__dirname, 'index.js'),
output: {
filename: '[name].js',
chunkFilename: 'chunk-[name].js',
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment