Last active
September 13, 2017 18:49
-
-
Save jshcrowthe/64ec07274e4ac966b3e116078c586dfa to your computer and use it in GitHub Desktop.
Demo consuming a module with Webpack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="/main.js"></script> | |
</head> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { logModule } from 'test-module'; | |
logModule(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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