lbry-desktop/src/renderer/webpack.common.js

56 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-11-08 04:54:22 +01:00
const path = require("path");
const webpack = require("webpack")
const appPath = path.resolve(__dirname, "js");
process.traceDeprecation = true;
const PATHS = {
2017-11-24 15:31:05 +01:00
app: path.join(__dirname, "src/main"),
2017-11-08 04:54:22 +01:00
dist: path.join(__dirname, "dist")
};
module.exports = {
entry: ["babel-polyfill", "./js/main.js"],
output: {
path: path.join(PATHS.dist, "js"),
publicPath: "/js/",
filename: "bundle.js"
},
resolve: {
modules: [appPath, "node_modules"],
2017-12-01 04:51:55 +01:00
extensions: [".js", ".jsx", ".css", ".json"]
2017-11-08 04:54:22 +01:00
},
module: {
rules: [
{
test: /\.jsx?$/,
enforce: "pre",
loaders: ["eslint"],
// define an include so we check just the files we need
include: PATHS.app
},
{
test: /\.node$/,
use: ["node-loader"]
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
cacheDirectory: true,
presets: [ "es2015", "react", "stage-2" ]
}
}
}
]
},
target: "electron-main",
};