sxy-test-runner 1.0.6 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/init.js +1 -1
- package/dist/cli/lib/loadTestFile.js +1 -1
- package/dist/cli/lib/runTests.js +5 -1
- package/dist/cli/lib/showTestLoadingError.js +11 -0
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.js +1 -1
- package/package.json +70 -68
- package/readme.md +206 -0
- package/sxy-loader.config.js +10 -0
package/dist/cli/init.js
CHANGED
|
@@ -100,7 +100,7 @@ export async function init() {
|
|
|
100
100
|
execution: {
|
|
101
101
|
|
|
102
102
|
// run test files in 'parallel' or 'sequential'ly
|
|
103
|
-
files: '
|
|
103
|
+
files: 'sequential',
|
|
104
104
|
|
|
105
105
|
// run describe blocks within a test file in 'parallel' or 'sequential'ly
|
|
106
106
|
describes: 'sequential',
|
|
@@ -51,7 +51,7 @@ export async function loadTestFile(config, testFile) {
|
|
|
51
51
|
test.error = false;
|
|
52
52
|
} catch (e) {
|
|
53
53
|
//error(chalk.red`Error loading file ${testFileFullUrl}`)
|
|
54
|
-
test.error = `Error loading file`;
|
|
54
|
+
test.error = `Error loading file\n${e}`;
|
|
55
55
|
} finally {
|
|
56
56
|
test.logs = logs; //// restore previous console.log function
|
|
57
57
|
|
package/dist/cli/lib/runTests.js
CHANGED
|
@@ -88,6 +88,10 @@ export async function runTests(config, testFiles, failingTests, customOut = unde
|
|
|
88
88
|
testsResultsSummary.describesInvalid += +runTestResult.describeResultsSummary.invalid;
|
|
89
89
|
testsResultsSummary.itsTotal += +runTestResult.describeResultsSummary.itsTotal;
|
|
90
90
|
testsResultsSummary.itsPasses += +runTestResult.describeResultsSummary.itsPasses; //testsResultsSummary.itsInvalid += +runTestResult.describeResultsSummary.itsInvalid // see comment above, not doing invalid tests
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
for (const testFile in erroringTests) {
|
|
94
|
+
testsResultsSummary.total++;
|
|
91
95
|
} //console.log('testsResultsSummary', testsResultsSummary)
|
|
92
96
|
|
|
93
97
|
|
|
@@ -124,7 +128,7 @@ export async function runTests(config, testFiles, failingTests, customOut = unde
|
|
|
124
128
|
|
|
125
129
|
|
|
126
130
|
const testFilesText = `Test Files: ${testsResultsSummary.passes}/${testsResultsSummary.total}`;
|
|
127
|
-
const invalidTestFilesText = testsResultsSummary.invalid >= 1 ? testsResultsSummary.invalid === 1 ? await chalk.grey(`(1 file without tests)`) : await chalk.grey(`(
|
|
131
|
+
const invalidTestFilesText = testsResultsSummary.invalid >= 1 ? testsResultsSummary.invalid === 1 ? await chalk.grey(`(+1 file without tests)`) : await chalk.grey(`(+${testsResultsSummary.invalid} files without tests)`) : '';
|
|
128
132
|
|
|
129
133
|
if (testsResultsSummary.passes === testsResultsSummary.total) {
|
|
130
134
|
await out((await chalk.mediumgreen(`${testFilesText}`)) + ' ' + invalidTestFilesText);
|
|
@@ -14,9 +14,20 @@ export async function showTestLoadingError(config, test, customOut = undefined)
|
|
|
14
14
|
const out = customOut ? async (...texts) => await customOut(...texts) : async (...texts) => await mainOut(...texts); //console.log('testResult', testResult)
|
|
15
15
|
|
|
16
16
|
await timeProfileAsync('show test loading error', () => {
|
|
17
|
+
const indent = ' ';
|
|
17
18
|
out();
|
|
18
19
|
out(chalk.grey`File ${test.file}`);
|
|
19
20
|
out(chalk.mediumred`Loading error: ${test.error}`);
|
|
21
|
+
|
|
22
|
+
if (test.logs.length > 0) {
|
|
23
|
+
out();
|
|
24
|
+
out(indent + chalk.grey`console.logs:`);
|
|
25
|
+
test.logs.forEach(async log => {
|
|
26
|
+
log[0] = indent + log[0];
|
|
27
|
+
await out(...log);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
20
31
|
out();
|
|
21
32
|
});
|
|
22
33
|
}
|
|
@@ -138,7 +138,7 @@ export async function watchFilesAndRunTestsNodeWatch(config, testFiles, dependen
|
|
|
138
138
|
passed: 0
|
|
139
139
|
};
|
|
140
140
|
await debug('run tests on change');
|
|
141
|
-
await debug('toTest', toTest); // clear load cache to allow accesing the new
|
|
141
|
+
await debug('toTest', toTest); // clear load cache to allow accesing the new test
|
|
142
142
|
|
|
143
143
|
await load.cache.clear();
|
|
144
144
|
const testResults = await runTests(config, toTest, failingTests, customOut);
|
package/package.json
CHANGED
|
@@ -1,68 +1,70 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "sxy-test-runner",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"license": "UNLICENSED",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"module": "./dist/index.js",
|
|
8
|
-
"bin": {
|
|
9
|
-
"sxy-test": "./dist/cli/index.js",
|
|
10
|
-
"sxy-test-runner": "./dist/cli/index.js"
|
|
11
|
-
},
|
|
12
|
-
"files": [
|
|
13
|
-
"dist"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"dev
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"unit-test
|
|
23
|
-
"unit-test-
|
|
24
|
-
"unit-test-
|
|
25
|
-
"unit-test-watch-files
|
|
26
|
-
"unit-test-watch-files-
|
|
27
|
-
"unit-test-watch": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/
|
|
28
|
-
"unit-test-
|
|
29
|
-
"unit-test-
|
|
30
|
-
"unit-test-
|
|
31
|
-
"unit-test-
|
|
32
|
-
"unit-test-run-describe
|
|
33
|
-
"unit-test-
|
|
34
|
-
"unit-test-
|
|
35
|
-
"unit-test-
|
|
36
|
-
"unit-test-
|
|
37
|
-
"unit-test-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"sxy-
|
|
52
|
-
"sxy-
|
|
53
|
-
"sxy-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "sxy-test-runner",
|
|
3
|
+
"version": "1.0.9",
|
|
4
|
+
"license": "UNLICENSED",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"bin": {
|
|
9
|
+
"sxy-test": "./dist/cli/index.js",
|
|
10
|
+
"sxy-test-runner": "./dist/cli/index.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"sxy-loader.config.js",
|
|
15
|
+
"readme.md"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "babel --watch --out-dir dist src",
|
|
19
|
+
"dev": "cross-env NODE_OPTIONS=\"--experimental-specifier-resolution=node\" nodemon --experimental-specifier-resolution=node --watch dist/cli --watch dist/cli/lib --watch sxy-test-runner.config.js --watch sxy-loader.config.js dist/cli/index.js",
|
|
20
|
+
"dev-once": "nodemon --experimental-specifier-resolution=node --watch dist/cli --watch sxy-test-runner.config.js --watch sxy-loader.config.js dist/cli/index.js once",
|
|
21
|
+
"dev-init": "node --experimental-specifier-resolution=node dist/cli/index.js init",
|
|
22
|
+
"unit-test": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/*.unitTest.js",
|
|
23
|
+
"unit-test-show-test-result": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/showTestResult.unitTest.js",
|
|
24
|
+
"unit-test-load-config": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/loadConfig.unitTest.js",
|
|
25
|
+
"unit-test-watch-files": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/watchFiles.unitTest.js",
|
|
26
|
+
"unit-test-watch-files-chokidar": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/watchFilesChokidar.unitTest.js",
|
|
27
|
+
"unit-test-watch-files-and-run-tests": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/watchFilesAndRunTests.unitTest.js",
|
|
28
|
+
"unit-test-watch-files-and-run-tests-chokidar": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/watchFilesAndRunTestsChokidar.unitTest.js",
|
|
29
|
+
"unit-test-watch": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/watch.unitTest.js",
|
|
30
|
+
"unit-test-inject-properties": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/injectProperties.unitTest.js",
|
|
31
|
+
"unit-test-run-it": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/runIt.unitTest.js",
|
|
32
|
+
"unit-test-run-describe": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/runDescribe.unitTest.js",
|
|
33
|
+
"unit-test-parse-describe": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/parseDescribe.unitTest.js",
|
|
34
|
+
"unit-test-run-describe-run": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/runDescribeRun.unitTest.js",
|
|
35
|
+
"unit-test-run-test": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/runTest.unitTest.js",
|
|
36
|
+
"unit-test-load-test-file": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/loadTestFile.unitTest.js",
|
|
37
|
+
"unit-test-add-exports": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/addExports.unitTest.js",
|
|
38
|
+
"unit-test-describe": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/describe.unitTest.js",
|
|
39
|
+
"unit-test-run-tests": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/runTests.unitTest.js",
|
|
40
|
+
"mocha-trial": "mocha --watch --parallel --config unitTesting/.mocharc.cjs --watch-files dist,unitTesting dist/**/runTest.unitTest.js"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@babel/core": "^7.18.5",
|
|
44
|
+
"chalk-extensions": "^1.0.1",
|
|
45
|
+
"cross-env": "^7.0.3",
|
|
46
|
+
"dependency-tree": "^8.1.2",
|
|
47
|
+
"figures": "^4.0.1",
|
|
48
|
+
"glob": "^7.2.3",
|
|
49
|
+
"globby": "^12.2.0",
|
|
50
|
+
"node-watch": "^0.7.3",
|
|
51
|
+
"sxy-dev-tools": "^1.0.6",
|
|
52
|
+
"sxy-helpers": "^1.0.0",
|
|
53
|
+
"sxy-loader": "^2.0.9",
|
|
54
|
+
"sxy-standard": "^1.0.11",
|
|
55
|
+
"sxy-standard-object-copy": "^1.0.5"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@babel/cli": "^7.17.10",
|
|
59
|
+
"babel-plugin-transform-awaitful": "^1.0.0",
|
|
60
|
+
"chai": "^4.3.6",
|
|
61
|
+
"chai-as-promised": "^7.1.1",
|
|
62
|
+
"eslint": "^7.32.0",
|
|
63
|
+
"eslint-config-sandi": "^1.2.0",
|
|
64
|
+
"mocha": "^9.2.2",
|
|
65
|
+
"mocha-steps": "^1.3.0",
|
|
66
|
+
"nodemon": "^2.0.16",
|
|
67
|
+
"sinon": "^12.0.1",
|
|
68
|
+
"sinon-chai": "^3.7.0"
|
|
69
|
+
}
|
|
70
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# sxy-test-runner
|
|
2
|
+
|
|
3
|
+
Mocha-like test runner for **es modules** (only), with **watch mode**, and **re-running only tests related to changes** (by dependency analysis)
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
import { describe } from 'sxy-test-runner'
|
|
7
|
+
import { should as setupShould } from 'chai'
|
|
8
|
+
const should = setupShould()
|
|
9
|
+
|
|
10
|
+
function add(a, b) {
|
|
11
|
+
return a + b
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe('The add() function', ({it}) => {
|
|
15
|
+
it('should add 1 and 2, making 3', () => {
|
|
16
|
+
const result = add(1, 2)
|
|
17
|
+
result.should.equal(3)
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
### 1. Install
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
npm i -D sxy-test-runner
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
*or*
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
yarn add -D sxy-test-runner
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
*or*
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
pnpm add -D sxy-test-runner
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
### 2. Create a config (required)
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
sxy-test-runner init
|
|
48
|
+
```
|
|
49
|
+
*sxy-test is an alias for sxy-test-runner and can be used instead*
|
|
50
|
+
|
|
51
|
+
This will create a config in your project folder. It can be moved to a folder named "config" if you prefer, or specify a location using --config
|
|
52
|
+
|
|
53
|
+
### 3. Modify the config, specifying the base path for tests and code to watch, and glob patterns for tests and code to watch
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
{
|
|
57
|
+
// base folder for tests matching and ignore patterns
|
|
58
|
+
testsBase: 'dist',
|
|
59
|
+
|
|
60
|
+
// glob pattern or array of glob patterns of test files
|
|
61
|
+
tests: [
|
|
62
|
+
'**/*.test.{js,jsx}'
|
|
63
|
+
],
|
|
64
|
+
|
|
65
|
+
// watch mode configurations
|
|
66
|
+
watch: {
|
|
67
|
+
|
|
68
|
+
//// the base directory to watch files in
|
|
69
|
+
watchFilesBase: 'dist',
|
|
70
|
+
|
|
71
|
+
//// glob filter or array of global filters of files to watch
|
|
72
|
+
watchFiles: '**/*.js',
|
|
73
|
+
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The other config options and fairly well explained in the config. More info on them later.
|
|
79
|
+
|
|
80
|
+
### 4. Run
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
npx sxy-test-runner
|
|
84
|
+
```
|
|
85
|
+
*sxy-test is an alias for sxy-test-runner and can be used instead*
|
|
86
|
+
|
|
87
|
+
("npx" can be omitted in package.json scripts)
|
|
88
|
+
|
|
89
|
+
sxy-test-runner runs watch mode, re-running only relevant tests, by default.
|
|
90
|
+
|
|
91
|
+
To run tests only once and not watch (e.g. for ci/cd), use
|
|
92
|
+
```
|
|
93
|
+
npx sxy-test-runner once
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
To specific an alternate config, use -c or --config
|
|
97
|
+
```
|
|
98
|
+
npx sxy-test-runner --config sxy-test-runner.alternate.config.js
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
# How it works
|
|
102
|
+
|
|
103
|
+
sxy-test-runner runs all tests inside one node process, to improve performance (this framework far exceeds mocha in parallel mode, which is needed to test ESM files, due to this).
|
|
104
|
+
|
|
105
|
+
Because of this, be careful with globals, which will be shared.
|
|
106
|
+
|
|
107
|
+
## Execution modes
|
|
108
|
+
|
|
109
|
+
*execution* settings let you choose where to run test files, describe blocks, and individual tests sequentially or in parallel.
|
|
110
|
+
|
|
111
|
+
If working with globals you may want to use sequential only, to avoid conflicts on those globals.
|
|
112
|
+
|
|
113
|
+
Sequential mode also allows console log output to be displayed correctly with each test. Running in parallel mode does not allow log output to be matched up to each test, due to the use of a global override on console.log (other console output methods such as console.trace() are not covered currently)
|
|
114
|
+
|
|
115
|
+
If your code is isolated, and asyncronous, you can use parallel exeecution modes to radically speed up your tests, as the expense of the points mentioned above.
|
|
116
|
+
|
|
117
|
+
## Dependencies
|
|
118
|
+
|
|
119
|
+
Module dependencies are identified using dependency-tree. Dynamic imports will not be detected and will not trigger test re-runs.
|
|
120
|
+
|
|
121
|
+
No option to re-run all tests on changes is currently available - I may add this on request, or submit a PR if you want this.
|
|
122
|
+
|
|
123
|
+
## Failing test re-running
|
|
124
|
+
|
|
125
|
+
Default behaviour is to re-run any failing test any time a change is made, even if that change isn't relevant to the failing test. This is to ensure you can see where attention is needed. Turn this off in the config if it is not convenient for you: config.watch.reRunFailingTests
|
|
126
|
+
|
|
127
|
+
## Reloading modules
|
|
128
|
+
|
|
129
|
+
A key challenge in creating an ESM test runner is re-loading modules due to the engine not letting us clear the import cache of ESM modules. This framework relies on sxy-loader, which uses a babel transform to transform modules into a reloadable format with a controllable cache. A cache of transformed code is kept to keep the process speedy.
|
|
130
|
+
|
|
131
|
+
Performance is a little less than a native module import, but not so much as to be notable inconvenience. Re-running only test related to changes keep performance strong even in very large projects.
|
|
132
|
+
|
|
133
|
+
# Advanced usage
|
|
134
|
+
|
|
135
|
+
## 1. Run tasks at startup - setup
|
|
136
|
+
|
|
137
|
+
Edit config.setup. This config value can take a function, a file to import relative to the project folder, or an array or one or both of those.
|
|
138
|
+
|
|
139
|
+
## 2. Run tasks before each test file / describe / test globally
|
|
140
|
+
|
|
141
|
+
Edit config.beforeEachFile / config.beforeEachDescribe / config.beforeEachTest with a function, file or array of either.
|
|
142
|
+
|
|
143
|
+
If a file exports named values, or a function returns an object with properties, these keys will be added to a storage object (beware of conflicting names). This object is then passed to the afterEachFile / afterEachDescribe / afterEachTest tasks for cleanup.
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
// tasks to run before each test file is run
|
|
147
|
+
beforeEachFile: () => {
|
|
148
|
+
const thing = prepSomething()
|
|
149
|
+
return { thing }
|
|
150
|
+
},
|
|
151
|
+
|
|
152
|
+
// tasks to run after each test file is run
|
|
153
|
+
afterEachFile: ({thing}) => {
|
|
154
|
+
destroyingSomething(thing)
|
|
155
|
+
},
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## 3. Run code before each describe block, or at the end of a test file - per test file
|
|
159
|
+
|
|
160
|
+
Not yet implemented.
|
|
161
|
+
|
|
162
|
+
## 4. Run code before each test, after each test, or after the describe block - per describe block
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
import { describe } from 'sxy-test-runner'
|
|
166
|
+
import { should as setupShould } from 'chai'
|
|
167
|
+
const should = setupShould()
|
|
168
|
+
|
|
169
|
+
describe('something', ({it, beforeEachTest, afterEachTest, afterDescribe}) => {
|
|
170
|
+
|
|
171
|
+
// setup can take place here without any special measures
|
|
172
|
+
// but you can only safely set globals for your test here if your
|
|
173
|
+
// execution mode for files and describes is 'sequential' (default)
|
|
174
|
+
const something = createSomething()
|
|
175
|
+
|
|
176
|
+
// run this just before each test
|
|
177
|
+
beforeEachTest(() => {
|
|
178
|
+
prepSomething(something)
|
|
179
|
+
})
|
|
180
|
+
|
|
181
|
+
// run this just after each test
|
|
182
|
+
afterEachTest(() => {
|
|
183
|
+
clearupSomething(something)
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
it('should do something', () => {
|
|
187
|
+
something.should.do.something
|
|
188
|
+
})
|
|
189
|
+
it('should do another thing', () => {
|
|
190
|
+
something.should.do.another.thing
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
// teardown should go in afterDescribe.
|
|
194
|
+
// tests are not run syncronously within the describe block (even sync tests)
|
|
195
|
+
// so cleanup code here would run too early
|
|
196
|
+
afterDescribe(() => {
|
|
197
|
+
destroySomething(something)
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
# Known issues
|
|
205
|
+
|
|
206
|
+
## sxy-loader uses eval to load and re-load modules, and this makes a big mess of error output. I am hoping for a solution to module reloading in the official spec to solve this. It may be possible to switch to a different method of re-loading modules to solve this (no plans for this just now).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
export default {
|
|
3
|
+
//returnStyle: 'esm-dynamic', // 'esm-dynamic' | 'esm-static'
|
|
4
|
+
mode: process.env.NODE_ENV, // 'development' | 'production' environment
|
|
5
|
+
//transformCaching: 'content', // content | hash | false // default content
|
|
6
|
+
//transformCacheStorage: 'file', // 'file' | 'memory'
|
|
7
|
+
transformCacheStorageLocation: 'loaderCache', // null | path/to/location/from/project/dir
|
|
8
|
+
quiet: true, // disable info output
|
|
9
|
+
debug: false, // debugging output // doesn't work yet
|
|
10
|
+
}
|