Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
berickson1 committed May 6, 2020
1 parent 7df8148 commit 43d97d6
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/comparison-tests/resolveJsonModule/app.ts
@@ -0,0 +1,3 @@
import * as file from "./file.json";

console.log(file.foo);
@@ -0,0 +1,17 @@
Asset Size Chunks Chunk Names
bundle.js 1.12 KiB 0 main
Entrypoint main = bundle.js
[0] ./app.ts 232 bytes {0} [built] [failed] [2 errors]

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/

ERROR in tsconfig.json
[tsl] ERROR
 TS18003: No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["ap.ts","file.json"]' and 'exclude' paths were '[]'.

ERROR in ./app.ts
Module build failed (from index.js):
Error: error while parsing tsconfig.json
at Object.loader (dist/index.js:19:18)
@@ -0,0 +1,17 @@
Asset Size Chunks Chunk Names
bundle.js 1.12 KiB 0 main
Entrypoint main = bundle.js
[0] ./app.ts 232 bytes {0} [built] [failed] [2 errors]

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/

ERROR in tsconfig.json
[tsl] ERROR
 TS18003: No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["ap.ts","file.json"]' and 'exclude' paths were '[]'.

ERROR in ./app.ts
Module build failed (from index.js):
Error: error while parsing tsconfig.json
at Object.loader (dist/index.js:19:18)
3 changes: 3 additions & 0 deletions test/comparison-tests/resolveJsonModule/file.json
@@ -0,0 +1,3 @@
{
"foo": "bar"
}
7 changes: 7 additions & 0 deletions test/comparison-tests/resolveJsonModule/tsconfig.json
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"resolveJsonModule": true,
"composite": true
},
"include": ["ap.ts", "file.json"]
}
12 changes: 12 additions & 0 deletions test/comparison-tests/resolveJsonModule/webpack.config.js
@@ -0,0 +1,12 @@
module.exports = {
entry: './app.ts',
output: {
filename: 'bundle.js'
},
resolve: {
extensions: ['.ts', '.json']
},
module: {
rules: [{ test: /\.tsx?$/, loader: 'ts-loader' }]
}
};

0 comments on commit 43d97d6

Please sign in to comment.