mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
#1026 fix bundles
This commit is contained in:
@@ -1,22 +1,27 @@
|
||||
const moduleIdRegex = /moduleId: module.id,/g;
|
||||
const moduleNameRegex = /moduleId: __moduleName,/g;
|
||||
const moduleIdPath = /module.id.replace/g;
|
||||
|
||||
module.exports = function(source) {
|
||||
this.cacheable();
|
||||
|
||||
let result = source;
|
||||
|
||||
if (moduleIdRegex.test(source)) {
|
||||
result = source.replace(moduleIdRegex, (match) => {
|
||||
return `// ${match}`;
|
||||
});
|
||||
source = source.replace(moduleIdRegex, (match) => {
|
||||
return `// ${match}`;
|
||||
});
|
||||
}
|
||||
|
||||
if (moduleNameRegex.test(source)) {
|
||||
result = source.replace(moduleNameRegex, (match) => {
|
||||
return `// ${match}`;
|
||||
});
|
||||
source = source.replace(moduleNameRegex, (match) => {
|
||||
return `// ${match}`;
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
if (moduleIdPath.test(source)) {
|
||||
source = source.replace(moduleIdPath, (match) => {
|
||||
return `''.replace`;
|
||||
});
|
||||
}
|
||||
|
||||
return source;
|
||||
}
|
||||
|
@@ -21,97 +21,105 @@ let alfrescoLibs = glob.sync(pattern, options);
|
||||
// let alfrescoLibsModules = alfrescoLibs.map(p => path.join(p, 'node_modules'));
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
'polyfills': './app/polyfills.ts',
|
||||
'vendor': './app/vendor.ts',
|
||||
'app': './app/main.ts'
|
||||
},
|
||||
entry: {
|
||||
'polyfills': './app/polyfills.ts',
|
||||
'vendor': './app/vendor.ts',
|
||||
'app': './app/main.ts'
|
||||
},
|
||||
|
||||
resolve: {
|
||||
extensions: ['', '.ts', '.js'],
|
||||
modules: [
|
||||
helpers.root('app'),
|
||||
helpers.root('node_modules')
|
||||
resolve: {
|
||||
extensions: ['', '.ts', '.js'],
|
||||
modules: [
|
||||
helpers.root('app'),
|
||||
helpers.root('node_modules')
|
||||
],
|
||||
root: rootPath,
|
||||
fallback: rootPath
|
||||
},
|
||||
|
||||
resolveLoader: {
|
||||
alias: {
|
||||
'systemjs-loader': helpers.root('config', 'loaders', 'system.js'),
|
||||
'debug-loader': helpers.root('config', 'loaders', 'debug.js')
|
||||
},
|
||||
fallback: rootPath
|
||||
},
|
||||
module: {
|
||||
preLoaders: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: [
|
||||
...alfrescoLibs
|
||||
],
|
||||
root: rootPath,
|
||||
fallback: rootPath
|
||||
},
|
||||
|
||||
resolveLoader: {
|
||||
alias: {
|
||||
'systemjs-loader': helpers.root('config', 'loaders', 'system.js'),
|
||||
'debug-loader': helpers.root('config', 'loaders', 'debug.js')
|
||||
},
|
||||
fallback: rootPath
|
||||
},
|
||||
|
||||
module: {
|
||||
loaders: [
|
||||
{
|
||||
test: /\.ts$/,
|
||||
loaders: ['awesome-typescript-loader', 'angular2-template-loader'],
|
||||
exclude: /node_modules/
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: [
|
||||
...alfrescoLibs
|
||||
loader: 'source-map-loader'
|
||||
}
|
||||
],
|
||||
loaders: [
|
||||
{
|
||||
test: /\.ts$/,
|
||||
loaders: ['awesome-typescript-loader', 'angular2-template-loader', 'systemjs-loader'],
|
||||
exclude: ['node_modules','public']
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: [
|
||||
...alfrescoLibs
|
||||
],
|
||||
loaders: ['angular2-template-loader', 'source-map-loader', 'systemjs-loader']
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
exclude: alfrescoLibs,
|
||||
loader: 'html'
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
loader: 'html'
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
include: alfrescoLibs,
|
||||
loader: 'html',
|
||||
query: {
|
||||
interpolate: true
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
|
||||
loader: 'html',
|
||||
query: {
|
||||
interpolate: true
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
|
||||
loader: 'file?name=assets/[name].[hash].[ext]'
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
exclude: [
|
||||
helpers.root('app'),
|
||||
...alfrescoLibs
|
||||
],
|
||||
loader: ExtractTextPlugin.extract('style', 'css?sourceMap')
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
helpers.root('app'),
|
||||
...alfrescoLibs
|
||||
],
|
||||
loader: ExtractTextPlugin.extract('style', 'css?sourceMap')
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
include: [
|
||||
helpers.root('app'),
|
||||
...alfrescoLibs
|
||||
],
|
||||
loader: 'raw'
|
||||
}
|
||||
]
|
||||
},
|
||||
helpers.root('app'),
|
||||
...alfrescoLibs
|
||||
],
|
||||
loader: 'raw'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
plugins: [
|
||||
|
||||
new webpack.ProvidePlugin({
|
||||
'dialogPolyfill': 'dialog-polyfill/dialog-polyfill'
|
||||
'dialogPolyfill': 'dialog-polyfill/dialog-polyfill'
|
||||
}),
|
||||
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: ['app', 'vendor', 'polyfills']
|
||||
name: ['app', 'vendor', 'polyfills']
|
||||
}),
|
||||
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'index.html'
|
||||
template: 'index.html'
|
||||
})
|
||||
],
|
||||
],
|
||||
|
||||
node: {
|
||||
fs: 'empty',
|
||||
module: false
|
||||
}
|
||||
node: {
|
||||
fs: 'empty',
|
||||
module: false
|
||||
}
|
||||
};
|
||||
|
@@ -5,7 +5,8 @@ var helpers = require('./helpers');
|
||||
var CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
|
||||
module.exports = webpackMerge(commonConfig, {
|
||||
devtool: 'cheap-module-source-map',
|
||||
|
||||
devtool: 'cheap-module-eval-source-map',
|
||||
|
||||
output: {
|
||||
path: helpers.root('dist'),
|
||||
|
Reference in New Issue
Block a user