Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support to spawn multiple compilers with different configs (#…
- Loading branch information
Showing
27 changed files
with
84 additions
and
16 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ | ||
console.log('Monkey D Luffy'); |
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,21 @@ | ||
const { existsSync } = require('fs'); | ||
const { resolve } = require('path'); | ||
// eslint-disable-next-line node/no-missing-require | ||
const { run } = require('../../utils/test-utils'); | ||
|
||
describe('Multiple config flag: ', () => { | ||
it('spawns multiple compilers for multiple configs', () => { | ||
const { stdout, stderr, exitCode } = run(__dirname, ['-c', 'webpack1.config.js', '-c', 'webpack2.config.js'], false); | ||
// Should contain the correct exit code | ||
expect(exitCode).toEqual(0); | ||
// Should spawn multiple compilers | ||
expect(stdout).toContain('Child amd:'); | ||
expect(stdout).toContain('Child commonjs:'); | ||
|
||
expect(stderr).toBeFalsy(); | ||
|
||
// should generate the correct output files | ||
expect(existsSync(resolve(__dirname, './dist/dist-commonjs.js'))).toBeTruthy(); | ||
expect(existsSync(resolve(__dirname, './dist/dist-amd.js'))).toBeTruthy(); | ||
}); | ||
}); |
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,10 @@ | ||
module.exports = { | ||
output: { | ||
filename: './dist-amd.js', | ||
libraryTarget: 'amd', | ||
}, | ||
name: 'amd', | ||
entry: './init.js', | ||
mode: 'production', | ||
devtool: 'eval-cheap-module-source-map', | ||
}; |
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,10 @@ | ||
module.exports = { | ||
output: { | ||
filename: './dist-commonjs.js', | ||
libraryTarget: 'commonjs', | ||
}, | ||
name: 'commonjs', | ||
entry: './init.js', | ||
mode: 'production', | ||
target: 'node', | ||
}; |
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