|
|
@ -88,67 +88,69 @@ loaders.push({ |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var webpackConfig = { |
|
|
|
function getWebpackMainConfig() { |
|
|
|
context: __dirname + '/app', |
|
|
|
return { |
|
|
|
|
|
|
|
context: __dirname + '/app', |
|
|
|
entry: _.merge({ |
|
|
|
|
|
|
|
'global': './global.js', |
|
|
|
entry: _.merge({ |
|
|
|
'core-app': './openproject-app.js' |
|
|
|
'global': './global.js', |
|
|
|
}, pluginEntries), |
|
|
|
'core-app': './openproject-app.js' |
|
|
|
|
|
|
|
}, pluginEntries), |
|
|
|
output: { |
|
|
|
|
|
|
|
filename: 'openproject-[name].js', |
|
|
|
output: { |
|
|
|
path: path.join(__dirname, '..', 'app', 'assets', 'javascripts', 'bundles'), |
|
|
|
filename: 'openproject-[name].js', |
|
|
|
publicPath: '/assets/bundles/' |
|
|
|
path: path.join(__dirname, '..', 'app', 'assets', 'javascripts', 'bundles'), |
|
|
|
}, |
|
|
|
publicPath: '/assets/bundles/' |
|
|
|
|
|
|
|
}, |
|
|
|
module: { |
|
|
|
|
|
|
|
loaders: loaders, |
|
|
|
module: { |
|
|
|
// Prevent 'This seems to be a pre-built javascript file.' error due to crossvent dist
|
|
|
|
loaders: loaders, |
|
|
|
noParse: /node_modules\/crossvent/, |
|
|
|
// Prevent 'This seems to be a pre-built javascript file.' error due to crossvent dist
|
|
|
|
}, |
|
|
|
noParse: /node_modules\/crossvent/ |
|
|
|
|
|
|
|
}, |
|
|
|
resolve: { |
|
|
|
|
|
|
|
root: __dirname, |
|
|
|
resolve: { |
|
|
|
|
|
|
|
root: __dirname, |
|
|
|
extensions: ['', '.webpack.js', '.ts', '.js'], |
|
|
|
|
|
|
|
|
|
|
|
extensions: ['', '.webpack.js', '.ts', '.js'], |
|
|
|
modulesDirectories: [ |
|
|
|
|
|
|
|
'node_modules', |
|
|
|
modulesDirectories: [ |
|
|
|
'bower_components', |
|
|
|
'node_modules', |
|
|
|
'vendor' |
|
|
|
'bower_components', |
|
|
|
].concat(pathConfig.pluginDirectories), |
|
|
|
'vendor' |
|
|
|
|
|
|
|
].concat(pathConfig.pluginDirectories), |
|
|
|
fallback: [path.join(__dirname, 'bower_components')], |
|
|
|
|
|
|
|
|
|
|
|
fallback: [path.join(__dirname, 'bower_components')], |
|
|
|
alias: _.merge({ |
|
|
|
|
|
|
|
'locales': './../../config/locales', |
|
|
|
alias: _.merge({ |
|
|
|
|
|
|
|
'locales': './../../config/locales', |
|
|
|
'angular-ui-date': 'angular-ui-date/src/date', |
|
|
|
|
|
|
|
'angular-truncate': 'angular-truncate/src/truncate', |
|
|
|
'angular-ui-date': 'angular-ui-date/src/date', |
|
|
|
'angular-context-menu': 'angular-context-menu/dist/angular-context-menu.js', |
|
|
|
'angular-truncate': 'angular-truncate/src/truncate', |
|
|
|
'mousetrap': 'mousetrap/mousetrap.js', |
|
|
|
'angular-context-menu': 'angular-context-menu/dist/angular-context-menu.js', |
|
|
|
'hyperagent': 'hyperagent/dist/hyperagent', |
|
|
|
'mousetrap': 'mousetrap/mousetrap.js', |
|
|
|
'ngFileUpload': 'ng-file-upload/ng-file-upload' |
|
|
|
'hyperagent': 'hyperagent/dist/hyperagent', |
|
|
|
}, pluginAliases) |
|
|
|
'ngFileUpload': 'ng-file-upload/ng-file-upload' |
|
|
|
}, |
|
|
|
}, pluginAliases) |
|
|
|
|
|
|
|
}, |
|
|
|
resolveLoader: { |
|
|
|
|
|
|
|
root: __dirname + '/node_modules' |
|
|
|
resolveLoader: { |
|
|
|
}, |
|
|
|
root: __dirname + '/node_modules' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plugins: [ |
|
|
|
|
|
|
|
new ExtractTextPlugin('openproject-[name].css'), |
|
|
|
|
|
|
|
new webpack.ProvidePlugin({ |
|
|
|
|
|
|
|
'_': 'lodash', |
|
|
|
|
|
|
|
'URI': 'URIjs', |
|
|
|
|
|
|
|
'URITemplate': 'URIjs/src/URITemplate' |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
new webpack.ResolverPlugin([ |
|
|
|
|
|
|
|
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin( |
|
|
|
|
|
|
|
'bower.json', ['main']) |
|
|
|
|
|
|
|
]) |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
plugins: [ |
|
|
|
module.exports = getWebpackMainConfig; |
|
|
|
new ExtractTextPlugin('openproject-[name].css'), |
|
|
|
|
|
|
|
new webpack.ProvidePlugin({ |
|
|
|
|
|
|
|
'_': 'lodash', |
|
|
|
|
|
|
|
'URI': 'URIjs', |
|
|
|
|
|
|
|
'URITemplate': 'URIjs/src/URITemplate' |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
new webpack.ResolverPlugin([ |
|
|
|
|
|
|
|
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin( |
|
|
|
|
|
|
|
'bower.json', ['main']) |
|
|
|
|
|
|
|
]) |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = webpackConfig; |
|
|
|
|
|
|
|