2014-10-30 16:56:34 +01:00
|
|
|
// docs: http://webpack.github.io/docs/configuration.html
|
2016-06-18 21:53:18 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const path = require('path');
|
2016-08-22 15:12:05 +02:00
|
|
|
const publicRoot = path.join(__dirname, 'public');
|
|
|
|
const jsroot = path.join(publicRoot, 'js');
|
2014-11-06 21:26:55 +01:00
|
|
|
|
2014-10-30 16:56:34 +01:00
|
|
|
module.exports = {
|
|
|
|
|
2016-04-24 22:41:37 +02:00
|
|
|
context: jsroot,
|
2016-06-19 20:47:34 +02:00
|
|
|
entry: './app.jsx',
|
2014-10-30 16:56:34 +01:00
|
|
|
|
|
|
|
output: {
|
2016-08-22 15:12:05 +02:00
|
|
|
path: publicRoot,
|
2014-10-30 16:56:34 +01:00
|
|
|
filename: 'bundle.js',
|
2016-06-18 21:55:46 +02:00
|
|
|
publicPath: '/js/',
|
2014-10-30 16:56:34 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
resolve: {
|
2016-04-24 22:41:37 +02:00
|
|
|
root: [jsroot],
|
2014-11-06 21:26:55 +01:00
|
|
|
extensions: ['', '.js', '.jsx'],
|
2016-06-18 21:55:46 +02:00
|
|
|
modulesDirectories: ['web_modules', 'node_modules'],
|
2014-10-30 16:56:34 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
module: {
|
|
|
|
loaders: [
|
2016-06-19 20:47:34 +02:00
|
|
|
{
|
|
|
|
test: /\.jsx?$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
loader: 'babel',
|
|
|
|
},
|
2016-06-18 21:55:46 +02:00
|
|
|
],
|
2014-10-30 16:56:34 +01:00
|
|
|
},
|
|
|
|
|
2016-06-18 21:55:46 +02:00
|
|
|
devtool: 'source-map',
|
2014-11-02 20:42:12 +01:00
|
|
|
|
2014-10-30 16:56:34 +01:00
|
|
|
externals: {
|
|
|
|
// stuff not in node_modules can be resolved here.
|
2016-06-18 21:55:46 +02:00
|
|
|
},
|
2014-10-30 16:56:34 +01:00
|
|
|
|
2014-11-06 21:26:55 +01:00
|
|
|
};
|