Skip to content

Commit

Permalink
Added predeployment scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
unimonkiez committed Apr 13, 2016
1 parent a1474d0 commit d1a000b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
dist/
npm-debug.log
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<head>
<meta charset="utf-8">
<title>Emoji window example</title>
<script type="text/javascript" src="dist/emoji-window.js"></script>
<script type="text/javascript" src="dist/emoji-window.min.js"></script>
</head>
<body>
sdsssssds
Yuval
</body>
</html>
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"main": "dist/emoji-window.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --progress",
"predeploy": "set NODE_ENV=development&& npm run build && set NODE_ENV=production&& npm run build",
"start": "webpack-dev-server --port 8080 --inline --progress --colors --config ./webpack.dev.config.js"
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const __PROD__ = process.env.NODE_ENV === 'production';
const __DEV__ = !__PROD__;

module.exports = {
devtool: __DEV__ ? 'source-map' : false,
devtool: false,
entry: {
'emoji-window': [
'./src/emoji-window.js'
Expand Down
2 changes: 2 additions & 0 deletions webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ 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
}),
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([
Expand Down

0 comments on commit d1a000b

Please sign in to comment.