-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to debug universal prod build #50
Comments
You're seeing the message In order to disable minifying, you'll need to customize your const webpackMerge = require('webpack-merge'),
webpackConfig = require('angular-webpack-config');
const aotPlugin = require('@ngtools/webpack').AotPlugin,
copyWebpackPlugin = require('copy-webpack-plugin'),
htmlElementsWebpackPlugin = require('html-elements-webpack-plugin');
const _ = require('lodash');
const mergeUnique = function(key, uniques, getter = a => a) {
return (a, b, k) => (
k === key && [
...b,
..._.differenceWith(
a, b, item => uniques.indexOf(getter(item)) >= 0
)
]
);
};
const browserConfig = function(root, settings) {
return {
/**
* Add additional plugins to the compiler.
*
* See: http://webpack.github.io/docs/configuration.html#plugins
*/
plugins: [
new aotPlugin({
tsConfigPath: './tsconfig.json',
entryModule: root(`${settings.paths.src.client.app.root}/app.browser.module#AppBrowserModule`)
}),
new copyWebpackPlugin([
{
from: `${root(settings.paths.src.client.assets.root)}/config.json`,
to: './config.json'
},
{
from: `${root(settings.paths.src.client.assets.root)}/i18n/en.json`,
to: './i18n/en.json'
},
{
from: `${root(settings.paths.src.client.assets.root)}/i18n/tr.json`,
to: './i18n/tr.json'
}
]),
new htmlElementsWebpackPlugin(require(root(`${settings.paths.config}/html-elements.config`)))
]
};
};
module.exports = function(options, root, settings) {
switch (options.env) {
case 'prod':
case 'production':
return !!options.platform
? options.platform === 'server'
? webpackConfig.universal.server.prod(root, settings)
: webpackMerge({
customizeArray: mergeUnique(
'plugins',
['UglifyJsPlugin'],
plugin => plugin.constructor && plugin.constructor.name
)
})(webpackConfig.universal.browser.prod(options, root, settings), browserConfig(root, settings))
: webpackMerge({
customizeArray: mergeUnique(
'plugins',
['UglifyJsPlugin'],
plugin => plugin.constructor && plugin.constructor.name
)
})(webpackConfig.universal.browser.prod(options, root, settings), browserConfig(root, settings));
case 'test':
case 'testing':
return webpackConfig.test(root, settings);
case 'dev':
case 'development':
return !!options.platform
? options.platform === 'server'
? webpackConfig.universal.server.dev(root, settings)
: webpackMerge(webpackConfig.universal.browser.dev(options, root, settings), browserConfig(root, settings))
: options.hmr
? webpackMerge(webpackConfig.spa.hmr(options, root, settings), browserConfig(root, settings))
: webpackMerge(webpackConfig.spa.dev(options, root, settings), browserConfig(root, settings));
}
}; This way, you'll be able to modify the plugins provided by However, I suggest you to re-clone the repo and perform a fresh |
Thanks I just got a 'No provider for StateTransferService!' Many many thanks 👍 |
I'm submitting a ... (check one with "x")
Hi,
Is there any way to trigger a debug for the aot universal production build ? Cause I have this issue 'No provider for t' and I can't figure out why...
Thanks ;)
The text was updated successfully, but these errors were encountered: