Skip to content

Commit

Permalink
Merge pull request #4682 from storybooks/tsconfig-path-umd-fix
Browse files Browse the repository at this point in the history
Fixes component imports from dist
  • Loading branch information
Hypnosphi authored Nov 5, 2018
2 parents db088ba + 4eefcbc commit c95c84d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/angular/src/server/angular-cli_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ export function applyAngularCliWebpackConfig(baseConfig, cliWebpackConfigOptions
plugins: [
new TsconfigPathsPlugin({
configFile: cliWebpackConfigOptions.buildOptions.tsConfig,
// After ng build my-lib the default value of 'main' in the package.json is 'umd'
// This causes that you cannot import components directly from dist
// https://github.com/angular/angular-cli/blob/9f114aee1e009c3580784dd3bb7299bdf4a5918c/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/browser.ts#L68
mainFields: [
...(cliWebpackConfigOptions.supportES2015 ? ['es2015'] : []),
'browser',
'module',
'main',
],
}),
],
};
Expand Down

0 comments on commit c95c84d

Please sign in to comment.