Commit a7058452 by Johannes Edmeier Committed by Johannes Edmeier

Fix the webpack build on windows

Make the webpackconfig handle windows paths correctly. fixes #363
parent be34f1d2
......@@ -9,6 +9,8 @@ var NgAnnotatePlugin = require('ng-annotate-webpack-plugin'),
var DIST = path.resolve(__dirname, 'target/dist');
var ROOT = __dirname;
var qPathSep = path.sep === '\\' ? '\\\\' : '/';
module.exports = {
context: ROOT,
entry: { 'applications-hystrix': './src/module.js' },
......@@ -30,21 +32,21 @@ module.exports = {
preLoaders: [{
test: /\.js$/,
loader: 'eslint',
exclude: [/node_modules/, /target\/hystrix-dashboard/]
exclude: [/node_modules/, /hystrix-dashboard/]
}],
loaders: [
{
test: /hystrix-dashboard\/js\/jquery\.tinysort\.min\.js$/,
test: new RegExp('hystrix-dashboard'+qPathSep+'js'+qPathSep+'jquery\.tinysort\.min\.js$'),
loader: 'imports?jQuery=jquery'
}, {
test: /hystrix-dashboard\/components\/hystrixCommand\/hystrixCommand\.js$/,
test: new RegExp('hystrix-dashboard'+qPathSep+'components'+qPathSep+'hystrixCommand'+qPathSep+'hystrixCommand\.js$'),
loaders: [
'imports?this=>global&jQuery=jquery&$=jquery&d3&tmpl=microtemplates&tsort',
'exports?window.HystrixCommandMonitor',
'regexp-replace?{"match": { "pattern": "\.\./components/hystrixCommand", "flags": "g" }, "replaceWith": "applications-hystrix/components/hystrixCommand"}'
]
}, {
test: /hystrix-dashboard\/components\/hystrixThreadPool\/hystrixThreadPool\.js$/,
test: new RegExp('hystrix-dashboard'+qPathSep+'components'+qPathSep+'hystrixThreadPool'+qPathSep+'hystrixThreadPool\.js$'),
loaders: [
'imports?this=>global&jQuery=jquery&$=jquery&d3&tmpl=microtemplates&tsort',
'exports?HystrixThreadPoolMonitor',
......
......@@ -12,13 +12,13 @@ var DIST = path.resolve(__dirname, 'target/dist');
var ROOT = __dirname;
var isDevServer = path.basename(require.main.filename) === 'webpack-dev-server.js';
var allModules = glob.sync(ROOT + '/modules/*/module.js').map(function (file) {
var allModules = glob.sync(path.join(ROOT,'/modules/*/module.js')).map(function (file) {
var name = /modules\/([^\/]+)\/module\.js/.exec(file)[1];
return {
name: name,
bundle: name + '/module',
entry: './' + path.relative(ROOT, file),
outputPath: name + '/'
entry: '.' + path.sep + path.relative(ROOT, file),
outputPath: name + path.sep
};
});
......@@ -94,19 +94,34 @@ module.exports = {
loader: ExtractTextPlugin.extract('style', 'css?-minimize')
}, {
test: /\.(jpg|png|gif|eot|svg|ttf|woff(2)?)(\?.*)?$/,
include: /\/(third-party|node_modules)\//,
include: /third-party/,
loader: 'file',
query: {
name: 'third-party/[2]',
regExp: '(third-party|node_modules)/(.+)'
name: '[path][name].[ext]'
}
}, {
test: /\.(jpg|png|gif|eot|svg|ttf|woff(2)?)(\?.*)?$/,
include: /node_modules/,
loader: 'file',
query: {
name: 'third-party/[path][name].[ext]',
context: 'node_modules'
}
}, {
test: /\.(jpg|png|gif)$/,
include: /\/(core|modules)\//,
include: /core/,
loader: 'file',
query: {
name: '[path][name].[ext]',
context: 'core'
}
}, {
test: /\.(jpg|png|gif)$/,
include: /modules/,
loader: 'file',
query: {
name: '[2]',
regExp: '(core|modules)/(.+)$'
name: '[path][name].[ext]',
context: 'modules'
}
}]
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment