Skip to content
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

Move externals plugin into configs #234

Merged
merged 1 commit into from
Jan 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/base.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import CssModulePlugin from '@dojo/webpack-contrib/css-module-plugin/CssModulePlugin';
import ExternalLoaderPlugin from '@dojo/webpack-contrib/external-loader-plugin/ExternalLoaderPlugin';
import BootstrapPlugin from '@dojo/webpack-contrib/bootstrap-plugin/BootstrapPlugin';
import I18nPlugin from '@dojo/webpack-contrib/i18n-plugin/I18nPlugin';
import registryTransformer from '@dojo/webpack-contrib/registry-transformer';
Expand Down Expand Up @@ -364,13 +363,6 @@ export default function webpackConfigFactory(args: any): webpack.Configuration {
cldrPaths: args.cldrPaths,
target: mainEntryPath
}),
args.externals &&
args.externals.dependencies &&
new ExternalLoaderPlugin({
dependencies: args.externals.dependencies,
hash: true,
outputPath: args.externals.outputPath
}),
!singleBundle &&
new webpack.DefinePlugin({
__MAIN_ENTRY: JSON.stringify(mainEntryPath)
Expand Down
8 changes: 8 additions & 0 deletions src/base.test.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as webpack from 'webpack';
import baseConfigFactory, { libraryName } from './base.config';
import ExternalLoaderPlugin from '@dojo/webpack-contrib/external-loader-plugin/ExternalLoaderPlugin';

const WrapperPlugin = require('wrapper-webpack-plugin');

Expand All @@ -12,6 +13,13 @@ function webpackConfig(args: any): webpack.Configuration {

config.plugins = [
...plugins!,
args.externals &&
args.externals.dependencies &&
new ExternalLoaderPlugin({
dependencies: args.externals.dependencies,
hash: true,
outputPath: args.externals.outputPath
}),
new WrapperPlugin({
test: /(all.*(\.js$))/,
footer: `typeof define === 'function' && define.amd && define(['${libraryName}'], function() {});`
Expand Down
8 changes: 8 additions & 0 deletions src/dev.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as fs from 'fs';
import * as path from 'path';
import webpack = require('webpack');
import BuildTimeRender from '@dojo/webpack-contrib/build-time-render/BuildTimeRender';
import ExternalLoaderPlugin from '@dojo/webpack-contrib/external-loader-plugin/ExternalLoaderPlugin';
import ServiceWorkerPlugin, {
ServiceWorkerOptions
} from '@dojo/webpack-contrib/service-worker-plugin/ServiceWorkerPlugin';
Expand Down Expand Up @@ -36,6 +37,13 @@ function webpackConfig(args: any): webpack.Configuration {
template: 'src/index.html',
cache: false
}),
args.externals &&
args.externals.dependencies &&
new ExternalLoaderPlugin({
dependencies: args.externals.dependencies,
hash: true,
outputPath: args.externals.outputPath
}),
manifest &&
new WebpackPwaManifest({
...manifest,
Expand Down
8 changes: 8 additions & 0 deletions src/dist.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import BuildTimeRender from '@dojo/webpack-contrib/build-time-render/BuildTimeRender';
import ExternalLoaderPlugin from '@dojo/webpack-contrib/external-loader-plugin/ExternalLoaderPlugin';
import BundleAnalyzerPlugin from '@dojo/webpack-contrib/webpack-bundle-analyzer/BundleAnalyzerPlugin';
import ServiceWorkerPlugin, {
ServiceWorkerOptions
Expand Down Expand Up @@ -63,6 +64,13 @@ function webpackConfig(args: any): webpack.Configuration {
template: 'src/index.html',
cache: false
}),
args.externals &&
args.externals.dependencies &&
new ExternalLoaderPlugin({
dependencies: args.externals.dependencies,
hash: true,
outputPath: args.externals.outputPath
}),
manifest &&
new WebpackPwaManifest({
...manifest,
Expand Down