1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-14 07:10:05 +02:00
copilot/frontend/webpack/test.js

38 lines
825 B
JavaScript
Raw Normal View History

2016-12-06 13:14:48 +02:00
const path = require('path');
const fs = require('fs');
const plugins = require('./plugins');
2016-12-06 13:14:48 +02:00
const CONTEXT = path.join(__dirname, '../src');
const ROOT = path.join(__dirname, '../..');
2016-10-24 14:23:05 +03:00
module.exports = {
2016-12-06 13:14:48 +02:00
resolve: {
modules: [
ROOT,
'node_modules'
],
alias: fs.readdirSync(CONTEXT)
.map((name) => path.join(CONTEXT, name))
.filter((fullpath) => fs.statSync(fullpath).isDirectory())
.reduce((aliases, fullpath) => Object.assign(aliases, {
[`@${path.basename(fullpath)}`]: fullpath
}), {
'@root': CONTEXT
})
},
2016-10-24 14:23:05 +03:00
output: {
2016-10-24 14:41:17 +03:00
libraryTarget: 'commonjs2'
2016-10-24 14:23:05 +03:00
},
plugins: [
2016-12-06 13:14:48 +02:00
plugins['no-errors'],
plugins['loader-options'],
plugins['define']
2016-10-24 14:23:05 +03:00
],
module: {
loaders: [{
test: /\.css?$/,
2016-12-06 13:17:38 +02:00
loader: 'ignore-loader'
2016-10-24 14:23:05 +03:00
}]
}
2016-10-24 16:11:50 +03:00
};