joyent-portal/ui/webpack/base.js

49 lines
989 B
JavaScript
Raw Normal View History

const gracefulFs = require('graceful-fs');
2016-10-24 16:14:03 +03:00
const path = require('path');
const fs = require('fs');
2016-10-24 16:14:03 +03:00
const plugins = require('./plugins');
const CONTEXT = path.join(__dirname, '../');
const STATIC = path.join(__dirname, '../static');
const SRC = path.join(__dirname, '../src');
const DOCS = path.join(__dirname, '../docs');
2016-10-24 16:14:03 +03:00
// PATCH `fs` to avoid ENFILE errors
gracefulFs.gracefulify(fs);
module.exports = {
devtool: 'eval',
context: CONTEXT,
entry: path.join(SRC, 'index.js'),
2016-10-24 16:14:03 +03:00
output: {
path: STATIC,
publicPath: '/',
filename: '[name].js'
2016-10-24 16:14:03 +03:00
},
plugins: [
plugins['no-errors'],
plugins['extract-text'],
plugins['loader-options']
2016-10-24 16:14:03 +03:00
],
module: {
loaders: [{
test: /js?$/,
exclude: /node_modules/,
include: [
SRC,
DOCS
2016-10-24 16:14:03 +03:00
],
loader: 'babel-loader'
2016-10-24 16:14:03 +03:00
}, {
test: /\.json?$/,
exclude: /node_modules/,
include: [
SRC,
DOCS
2016-10-24 16:14:03 +03:00
],
loader: 'json-loader'
2016-10-24 16:14:03 +03:00
}]
}
};