-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Guillaume Chau
committed
Nov 20, 2018
1 parent
390995f
commit c6adde5
Showing
4 changed files
with
55 additions
and
10 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
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,14 @@ | ||
/** @typedef {import('../lib/PackPluginAPI.js')} PackPluginApi */ | ||
/** @typedef {import('../lib/options.js').ProjectOptions} ProjectOptions */ | ||
|
||
/** | ||
* @param {PackPluginApi} api | ||
* @param {ProjectOptions} options | ||
*/ | ||
exports.getDefaultPort = async function (api, options, args) { | ||
const portfinder = require('portfinder') | ||
const result = await portfinder.getPortPromise({ | ||
port: args.port || options.defaultPort, | ||
}) | ||
return result | ||
} |
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 |
---|---|---|
@@ -1,24 +1,33 @@ | ||
import Config from 'webpack-chain' | ||
|
||
export interface ProjectOptions { | ||
/** folder output for prod build */ | ||
/** Folder output for prod build */ | ||
outputDir?: string | ||
/** folder containing source */ | ||
/** | ||
* Folder containing source. | ||
* By default will be aliased to `@/` | ||
* (for example, `@/lib/foo.js` will be resolved as `src/lib/foo.js`). | ||
*/ | ||
srcDir?: string | ||
/** entry file */ | ||
/** Entry file (relative to project root) */ | ||
entry?: string | ||
/** enable sourcemaps in production build */ | ||
/** Enable sourcemaps in production build (can slow down build) */ | ||
productionSourceMap?: boolean | ||
/** webpack externals */ | ||
/** Webpack externals packages */ | ||
externals?: any | ||
/** whitelist option for webpack-node-externals */ | ||
/** Whitelist option for webpack-node-externals */ | ||
nodeExternalsWhitelist?: any | ||
/** modify webpack config with webpack-chain */ | ||
/** Modify webpack config with webpack-chain */ | ||
chainWebpack?: (config: Config) => void | ||
/** enable parallel compilation */ | ||
/** Enable parallel compilation */ | ||
parallel?: boolean | ||
/** force transpile node_modules packages with babel */ | ||
/** Force transpile `node_modules` packages with babel */ | ||
transpileDependencies?: Array.<string | RegExp> | ||
/** options for 3rd-party plugins */ | ||
/** | ||
* Default port for `process.env.PORT` if it is not defined. | ||
* It will change to a free port automatically if it is not available. | ||
*/ | ||
defaultPort?: number | ||
/** Options for 3rd-party plugins */ | ||
pluginOptions?: any | ||
} |