Skip to content

Commit

Permalink
Added example to be built before deployment and while developing
Browse files Browse the repository at this point in the history
  • Loading branch information
unimonkiez committed Apr 13, 2016
1 parent d1a000b commit a1e74dd
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
7 changes: 7 additions & 0 deletions example/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"root": true,
"env": {
"browser": true,
"node": false
}
}
1 change: 1 addition & 0 deletions example/example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log(12345);
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>Emoji window example</title>
<script type="text/javascript" src="dist/emoji-window.min.js"></script>
<script type="text/javascript" src="dist/example.min.js"></script>
</head>
<body>
Yuval
Expand Down
1 change: 0 additions & 1 deletion src/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"root": true,
"parser": "babel-eslint",
"env": {
"browser": true,
"node": false
Expand Down
3 changes: 3 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ module.exports = {
entry: {
'emoji-window': [
'./src/emoji-window.js'
],
example: [
'./example/example.js'
]
},
output: {
Expand Down
7 changes: 4 additions & 3 deletions webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ const webpackBaseConfig = require('./webpack.config');
module.exports =
Object.assign(webpackBaseConfig, {
devtool: 'source-map', // Add source maps
entry: Object.assign(webpackBaseConfig.entry, {
base: [] // Hot model replacement code will be injected here
entry: Object.assign({}, {
example: webpackBaseConfig.entry.example,
base: [] // Hot reload will be injected here
}),
output: Object.assign(webpackBaseConfig.output, {
filename: '[name].min.js', // Change js file name to `min.js` even though it's not minified just so won't need to change `index.html` to fit github
publicPath: 'dist' // So that index.html won't need to change emoji-windiw.js import location also on github
}),
plugins: webpackBaseConfig.plugins.concat([
new HtmlWebpackPlugin({
chunks: ['base'],
chunks: ['base'], // Others are added manually to `index.html`
template: './index.html',
inject: 'head'
})
Expand Down

0 comments on commit a1e74dd

Please sign in to comment.