lbry-desktop/ui/webpack.config.js

53 lines
1.1 KiB
JavaScript
Raw Normal View History

2016-11-22 21:19:08 +01:00
const path = require('path');
const webpack = require('webpack')
2017-04-07 07:15:22 +02:00
const appPath = path.resolve(__dirname, 'js');
2016-11-22 21:19:08 +01:00
const PATHS = {
app: path.join(__dirname, 'app'),
dist: path.join(__dirname, 'dist')
};
module.exports = {
entry: ['babel-polyfill', './js/main.js'],
2016-11-22 21:19:08 +01:00
output: {
2017-01-26 18:40:44 +01:00
path: path.join(PATHS.dist, 'js'),
publicPath: '/js/',
2016-11-22 21:19:08 +01:00
filename: "bundle.js"
},
devtool: 'source-map',
2017-04-07 07:15:22 +02:00
resolve: {
root: appPath,
extensions: ['', '.js', '.jsx', '.css'],
},
plugins: [
new webpack.DefinePlugin({
ENV: JSON.stringify("production"),
}),
],
2016-11-22 21:19:08 +01:00
module: {
preLoaders: [
{
test: /\.jsx?$/,
loaders: ['eslint'],
// define an include so we check just the files we need
include: PATHS.app
}
],
loaders: [
{ test: /\.css$/, loader: "style!css" },
{
2017-04-07 07:15:22 +02:00
test: /\.jsx?$/,
loader: 'babel',
query: {
cacheDirectory: true,
presets:[ 'es2015', 'react', 'stage-2' ]
}
2017-05-25 19:40:46 +02:00
},
{
test: /mime\.json$/,
loader: 'json',
},
2016-11-22 21:19:08 +01:00
]
2017-01-19 10:50:08 +01:00
},
target: 'electron-main',
};