-
-
Notifications
You must be signed in to change notification settings - Fork 591
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
Showing
5 changed files
with
45 additions
and
20 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
test/build/config-format/disable-interpret/disable-interpret.test.js
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,24 @@ | ||
const { run } = require("../../../utils/test-utils"); | ||
const { existsSync, unlinkSync } = require("fs"); | ||
const { resolve } = require("path"); | ||
|
||
// eslint-disable-next-line node/no-unpublished-require | ||
const execa = require("execa"); | ||
const { sync: spawnSync } = execa; | ||
|
||
describe("webpack cli", () => { | ||
it('should work with the "disable-interpret" option from flags', async () => { | ||
const configFileName = "webpack.config"; | ||
const configFilePath = resolve(__dirname, `${configFileName}.ts`); | ||
const buildScripts = spawnSync("yarn", ["tsc", configFilePath]); | ||
expect(buildScripts.stdout).toBeTruthy(); | ||
|
||
const { exitCode, stderr, stdout } = await run(__dirname, ["--disable-interpret"]); | ||
unlinkSync(resolve(__dirname, `${configFileName}.js`)); | ||
|
||
expect(stderr).toBeFalsy(); | ||
expect(stdout).toBeTruthy(); | ||
expect(exitCode).toBe(0); | ||
expect(existsSync(resolve(__dirname, "dist/foo.bundle.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 @@ | ||
console.log("Main typescript file"); |
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,5 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs" | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
test/build/config-format/disable-interpret/webpack.config.ts
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 @@ | ||
/* eslint-disable node/no-unsupported-features/es-syntax */ | ||
/** eslint-disable **/ | ||
import * as path from "path"; | ||
|
||
const config = { | ||
mode: "production", | ||
entry: "./main.ts", | ||
output: { | ||
path: path.resolve(__dirname, "dist"), | ||
filename: "foo.bundle.js", | ||
}, | ||
}; | ||
|
||
export = config; |
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