Skip to content

Commit

Permalink
closes #1, base working
Browse files Browse the repository at this point in the history
  • Loading branch information
Travmatth committed Nov 18, 2016
1 parent 0844009 commit 3e0fe40
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"build": "webpack --config tools/webpack.config.dev.js --progress --display-chunks --display-reasons --display-error-details --display-modules",
"start": "webpack-dev-server --content-base dist/",
"start": "webpack-dev-server --config tools/webpack.config.dev.js --hot --inline --content-base dist/ --color",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand All @@ -23,6 +23,8 @@
"html-webpack-plugin": "^2.24.1",
"path": "^0.12.7",
"webpack": "^1.13.3",
"webpack-dev-server": "^1.16.2"
"webpack-dev-server": "^1.16.2",
"webpack-stats-plugin": "^0.1.4",
"webpack-validator": "^2.2.9"
}
}
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
document.addEventListener('DOMContentLoaded', function () {
console.log('Aloha');
console.log('what');
});
8 changes: 6 additions & 2 deletions tools/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ var paths = {
publicPath: '/',
entry: path.resolve(root, './src/index.js'),
outputFolder: path.resolve(root, './dist'),
resolveExtensions: ['', '.js'],
}

exports.PATHS = paths
module.exports = {
PATHS: paths,
pathTo: function() {
},
resolveExtensions: ['', '.js'],
}
16 changes: 12 additions & 4 deletions tools/webpack.config.dev.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
var webpack = require('webpack')
var common = require('./common')
var webpack = require('webpack')
var validate = require('webpack-validator')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var StatsWriterPlugin = require("webpack-stats-plugin").StatsWriterPlugin;

module.exports = validate({
devtool: 'cheap-module-eval-source-map',

module.exports = {
entry: {
index: common.PATHS.entry
index: common.PATHS.entry,
},

output: {
filename: '[name].js',
path: common.PATHS.outputFolder,
Expand All @@ -19,11 +24,14 @@ module.exports = {
module: {
loaders: []
},

plugins: [
// Write out stats file to build directory.
new StatsWriterPlugin(),
new HtmlWebpackPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
'__DEV__': true
}),
],
}
})

0 comments on commit 3e0fe40

Please # to comment.