-
Notifications
You must be signed in to change notification settings - Fork 26.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Webpack Configuration (#9651)
* WIP * Move data experiment * Do not throw away rules * Remove test code * Correct next data behavior * Add support for async composing * Remove unnecessary workaround * Rename Field
- Loading branch information
Showing
11 changed files
with
483 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import curry from 'lodash.curry' | ||
import { Configuration } from 'webpack' | ||
import { ConfigurationContext } from '../utils' | ||
|
||
export const base = curry(function base( | ||
ctx: ConfigurationContext, | ||
config: Configuration | ||
) { | ||
config.mode = ctx.isDevelopment ? 'development' : 'production' | ||
config.name = ctx.isServer ? 'server' : 'client' | ||
config.target = ctx.isServer ? 'node' : 'web' | ||
|
||
config.devtool = ctx.isDevelopment | ||
? 'cheap-module-source-map' | ||
: ctx.isProduction | ||
? false | ||
: false | ||
|
||
if (!config.module) { | ||
config.module = { rules: [] } | ||
} | ||
config.module.strictExportPresence = true | ||
|
||
return config | ||
}) |
Oops, something went wrong.