-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add in fusionConfig: jsExtPattern, resolveExtensions (enable typescript) #411
base: master
Are you sure you want to change the base?
Changes from 6 commits
3011e8c
b404074
027c374
a111b70
854fb7a
b006ff2
2829f39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,31 @@ module.exports = { | |
|
||
**Please note that custom Babel config is an unstable API and may not be supported in future releases.** | ||
|
||
## `jsExtPattern` | ||
|
||
By default this is `/\.(mjs|js|jsx)$/` | ||
|
||
For example, this enables Typescript support by adding the appropriate Babel preset: | ||
|
||
```js | ||
module.exports = { | ||
jsExtPattern: /[jt]sx?$/, | ||
babel: { | ||
presets: ["@babel/preset-typescript"], | ||
} | ||
}; | ||
``` | ||
|
||
```js | ||
module.exports = { | ||
resolveExtensions: ['.wasm', '.mjs', '.js', '.json', '.ts', '.tsx'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add the following to enable Typescript-compatible tests.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know what should be a flow now, as this PR was forked (imported) to the internal github repository... is updating this PR still something valuable ? @AlexMSmithCA There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (See above) |
||
}; | ||
``` | ||
|
||
## `resolveExtensions` | ||
|
||
By default this is the Webpack default which is: `['.wasm', '.mjs', '.js', '.json']` | ||
|
||
## `assumeNoImportSideEffects` | ||
|
||
By default this is `false`. | ||
|
@@ -49,6 +74,35 @@ module.exports = { | |
}; | ||
``` | ||
|
||
## `jest` | ||
|
||
``` | ||
globFileExt?: string | ||
transformIgnorePatterns?: Array<string> | ||
setupFilesAfterEnv?: Array<string> | ||
``` | ||
|
||
#### globFileExt | ||
default: `.js` | ||
|
||
This glob file extension pattern is used by jest to find test files and | ||
aggregate coverage raport. | ||
|
||
#### transformIgnorePatterns | ||
default: `['/node_modules/(?!(fusion-cli.*build))']` | ||
|
||
An array of regexp pattern strings that are matched against all source file | ||
paths before transformation. If the test path matches any of the patterns, it | ||
will not be transformed. | ||
|
||
#### setupFilesAfterEnv | ||
default: `undefined` | ||
|
||
A list of paths to modules that run some code to configure or set up the | ||
testing framework before each test. This script file presents you the | ||
opportunity of running some code immediately after the test framework has been | ||
installed in the environment. | ||
|
||
## `gzip` | ||
|
||
This is an optional property that can be used to override the Fusion.js defaults for compressing projects using zlib in production builds. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a dot before
[jt]
please.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what should be a flow now, as this PR was forked (imported) to the internal github repository... is updating this PR still something valuable ? @AlexMSmithCA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to make these changes in this PR. We can re-import any additional commits once this has been fully reviewed.