-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webpack): generate React and Web apps with webpack.config.js file (
- Loading branch information
Showing
78 changed files
with
404 additions
and
291 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { | ||
checkFilesDoNotExist, | ||
checkFilesExist, | ||
cleanupProject, | ||
newProject, | ||
runCLI, | ||
runCLIAsync, | ||
tmpProjPath, | ||
uniq, | ||
updateFile, | ||
} from '@nrwl/e2e/utils'; | ||
import { execSync } from 'child_process'; | ||
|
||
describe('Node Applications + esbuild', () => { | ||
beforeEach(() => newProject()); | ||
|
||
afterEach(() => cleanupProject()); | ||
|
||
it('should generate an app using esbuild', async () => { | ||
const app = uniq('nodeapp'); | ||
|
||
runCLI(`generate @nrwl/node:app ${app} --bundler=esbuild --no-interactive`); | ||
|
||
checkFilesDoNotExist(`apps/${app}/webpack.config.js`); | ||
|
||
updateFile(`apps/${app}/src/main.ts`, `console.log('Hello World!');`); | ||
await runCLIAsync(`build ${app}`); | ||
|
||
checkFilesExist(`dist/apps/${app}/main.cjs`); | ||
const result = execSync(`node dist/apps/${app}/main.cjs`, { | ||
cwd: tmpProjPath(), | ||
}).toString(); | ||
expect(result).toMatch(/Hello World!/); | ||
}, 300_000); | ||
}); |
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,35 @@ | ||
import { | ||
checkFilesDoNotExist, | ||
checkFilesExist, | ||
cleanupProject, | ||
newProject, | ||
runCLI, | ||
runCLIAsync, | ||
tmpProjPath, | ||
uniq, | ||
updateFile, | ||
} from '@nrwl/e2e/utils'; | ||
import { execSync } from 'child_process'; | ||
|
||
describe('Node Applications + webpack', () => { | ||
beforeEach(() => newProject()); | ||
|
||
afterEach(() => cleanupProject()); | ||
|
||
it('should generate an app using webpack', async () => { | ||
const app = uniq('nodeapp'); | ||
|
||
runCLI(`generate @nrwl/node:app ${app} --bundler=webpack --no-interactive`); | ||
|
||
checkFilesExist(`apps/${app}/webpack.config.js`); | ||
|
||
updateFile(`apps/${app}/src/main.ts`, `console.log('Hello World!');`); | ||
await runCLIAsync(`build ${app}`); | ||
|
||
checkFilesExist(`dist/apps/${app}/main.js`); | ||
const result = execSync(`node dist/apps/${app}/main.js`, { | ||
cwd: tmpProjPath(), | ||
}).toString(); | ||
expect(result).toMatch(/Hello World!/); | ||
}, 300_000); | ||
}); |
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
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
Oops, something went wrong.