Skip to content

Instantly share code, notes, and snippets.

@jshcrowthe
Last active September 13, 2017 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jshcrowthe/64ec07274e4ac966b3e116078c586dfa to your computer and use it in GitHub Desktop.
Save jshcrowthe/64ec07274e4ac966b3e116078c586dfa to your computer and use it in GitHub Desktop.
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