{"id":5177,"date":"2022-01-18T21:32:48","date_gmt":"2022-01-18T12:32:48","guid":{"rendered":"https:\/\/akamist.com\/blog\/?p=5177"},"modified":"2022-01-25T10:14:18","modified_gmt":"2022-01-25T01:14:18","slug":"%e3%82%a8%e3%83%a9%e3%83%bc","status":"publish","type":"post","link":"https:\/\/akamist.com\/blog\/archives\/5177","title":{"rendered":"\u30a8\u30e9\u30fc: TS18002: The 'files' list in config file 'tsconfig.json' is empty"},"content":{"rendered":"<h2>\u767a\u751f\u3057\u305f\u30a8\u30e9\u30fc<\/h2>\n<p>webpack\u3067TypeScript\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u30d3\u30eb\u3068\u3057\u3088\u3046\u3068\u3057\u305f\u3068\u3053\u308d\u3001<code>'tsconfig.json' is empty<\/code>\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3002<\/p>\n<pre><code class=\"language-bash\">$ npx webpack --config .\/webpack.config.dev.js\n\nasset main.js 1.58 KiB [emitted] (name: main)\n.\/src\/index.ts 39 bytes [built] [code generated] [2 errors]\n\nERROR in .\/src\/index.ts\n[tsl] ERROR\n      TS18002: The 'files' list in config file 'tsconfig.json' is empty.\n<\/code><\/pre>\n<h2>\u74b0\u5883<\/h2>\n<pre><code class=\"language-bash\">npx webpack -v\n\nwebpack: 5.66.0\nwebpack-cli: 4.9.1\nwebpack-dev-server not installed\n<\/code><\/pre>\n<pre><code class=\"language-bash\">npx tsc --version\n\nVersion 4.5.4\n<\/code><\/pre>\n<h2>\u539f\u56e0<\/h2>\n<p>\u30a8\u30e9\u30fc\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u901a\u308a\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b<code>tsconfig.json<\/code>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u3063\u3066\u306a\u304b\u3063\u305f<\/p>\n<h2>\u5bfe\u5fdc<\/h2>\n<p>\u30b3\u30de\u30f3\u30c9<code>npx tsc --init<\/code>\u3067<code>tsconfig.json<\/code>\u306e\u96db\u5f62\u3092\u4f5c\u6210\u3057\u305f\u3068\u3053\u308d\u3001\u4e0a\u8a18\u306e\u30a8\u30e9\u30fc\u306f\u89e3\u6d88\u3055\u308c\u305f\u3002<\/p>\n<pre><code class=\"language-bash\">$ npx tsc --init\n\nCreated a new tsconfig.json with:\n  target: es2016\n  module: commonjs\n  strict: true\n  esModuleInterop: true\n  skipLibCheck: true\n  forceConsistentCasingInFileNames: true\n<\/code><\/pre>\n<h2>\u4f5c\u6210\u3055\u308c\u305ftsconfig.json\u306e\u96db\u5f62<\/h2>\n<p>\u4f5c\u6210\u3055\u308c\u305f\u96db\u5f62\u306f\u4ee5\u4e0b\u306e\u3082\u306e\u3067\u3042\u3063\u305f<\/p>\n<pre><code class=\"language-bash\">{\n  \"compilerOptions\": {\n    \/* Visit https:\/\/aka.ms\/tsconfig.json to read more about this file *\/\n\n    \/* Projects *\/\n    \/\/ \"incremental\": true,                              \/* Enable incremental compilation *\/\n    \/\/ \"composite\": true,                                \/* Enable constraints that allow a TypeScript project to be used with project references. *\/\n    \/\/ \"tsBuildInfoFile\": \".\/\",                          \/* Specify the folder for .tsbuildinfo incremental compilation files. *\/\n    \/\/ \"disableSourceOfProjectReferenceRedirect\": true,  \/* Disable preferring source files instead of declaration files when referencing composite projects *\/\n    \/\/ \"disableSolutionSearching\": true,                 \/* Opt a project out of multi-project reference checking when editing. *\/\n    \/\/ \"disableReferencedProjectLoad\": true,             \/* Reduce the number of projects loaded automatically by TypeScript. *\/\n\n    \/* Language and Environment *\/\n    \"target\": \"es2016\",                                  \/* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. *\/\n    \/\/ \"lib\": [],                                        \/* Specify a set of bundled library declaration files that describe the target runtime environment. *\/\n    \/\/ \"jsx\": \"preserve\",                                \/* Specify what JSX code is generated. *\/\n    \/\/ \"experimentalDecorators\": true,                   \/* Enable experimental support for TC39 stage 2 draft decorators. *\/\n    \/\/ \"emitDecoratorMetadata\": true,                    \/* Emit design-type metadata for decorated declarations in source files. *\/\n    \/\/ \"jsxFactory\": \"\",                                 \/* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' *\/\n    \/\/ \"jsxFragmentFactory\": \"\",                         \/* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. *\/\n    \/\/ \"jsxImportSource\": \"\",                            \/* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` *\/\n    \/\/ \"reactNamespace\": \"\",                             \/* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. *\/\n    \/\/ \"noLib\": true,                                    \/* Disable including any library files, including the default lib.d.ts. *\/\n    \/\/ \"useDefineForClassFields\": true,                  \/* Emit ECMAScript-standard-compliant class fields. *\/\n\n    \/* Modules *\/\n    \"module\": \"commonjs\",                                \/* Specify what module code is generated. *\/\n    \/\/ \"rootDir\": \".\/\",                                  \/* Specify the root folder within your source files. *\/\n    \/\/ \"moduleResolution\": \"node\",                       \/* Specify how TypeScript looks up a file from a given module specifier. *\/\n    \/\/ \"baseUrl\": \".\/\",                                  \/* Specify the base directory to resolve non-relative module names. *\/\n    \/\/ \"paths\": {},                                      \/* Specify a set of entries that re-map imports to additional lookup locations. *\/\n    \/\/ \"rootDirs\": [],                                   \/* Allow multiple folders to be treated as one when resolving modules. *\/\n    \/\/ \"typeRoots\": [],                                  \/* Specify multiple folders that act like `.\/node_modules\/@types`. *\/\n    \/\/ \"types\": [],                                      \/* Specify type package names to be included without being referenced in a source file. *\/\n    \/\/ \"allowUmdGlobalAccess\": true,                     \/* Allow accessing UMD globals from modules. *\/\n    \/\/ \"resolveJsonModule\": true,                        \/* Enable importing .json files *\/\n    \/\/ \"noResolve\": true,                                \/* Disallow `import`s, `require`s or `&lt;reference&gt;`s from expanding the number of files TypeScript should add to a project. *\/\n\n    \/* JavaScript Support *\/\n    \/\/ \"allowJs\": true,                                  \/* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. *\/\n    \/\/ \"checkJs\": true,                                  \/* Enable error reporting in type-checked JavaScript files. *\/\n    \/\/ \"maxNodeModuleJsDepth\": 1,                        \/* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. *\/\n\n    \/* Emit *\/\n    \/\/ \"declaration\": true,                              \/* Generate .d.ts files from TypeScript and JavaScript files in your project. *\/\n    \/\/ \"declarationMap\": true,                           \/* Create sourcemaps for d.ts files. *\/\n    \/\/ \"emitDeclarationOnly\": true,                      \/* Only output d.ts files and not JavaScript files. *\/\n    \/\/ \"sourceMap\": true,                                \/* Create source map files for emitted JavaScript files. *\/\n    \/\/ \"outFile\": \".\/\",                                  \/* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. *\/\n    \/\/ \"outDir\": \".\/\",                                   \/* Specify an output folder for all emitted files. *\/\n    \/\/ \"removeComments\": true,                           \/* Disable emitting comments. *\/\n    \/\/ \"noEmit\": true,                                   \/* Disable emitting files from a compilation. *\/\n    \/\/ \"importHelpers\": true,                            \/* Allow importing helper functions from tslib once per project, instead of including them per-file. *\/\n    \/\/ \"importsNotUsedAsValues\": \"remove\",               \/* Specify emit\/checking behavior for imports that are only used for types *\/\n    \/\/ \"downlevelIteration\": true,                       \/* Emit more compliant, but verbose and less performant JavaScript for iteration. *\/\n    \/\/ \"sourceRoot\": \"\",                                 \/* Specify the root path for debuggers to find the reference source code. *\/\n    \/\/ \"mapRoot\": \"\",                                    \/* Specify the location where debugger should locate map files instead of generated locations. *\/\n    \/\/ \"inlineSourceMap\": true,                          \/* Include sourcemap files inside the emitted JavaScript. *\/\n    \/\/ \"inlineSources\": true,                            \/* Include source code in the sourcemaps inside the emitted JavaScript. *\/\n    \/\/ \"emitBOM\": true,                                  \/* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. *\/\n    \/\/ \"newLine\": \"crlf\",                                \/* Set the newline character for emitting files. *\/\n    \/\/ \"stripInternal\": true,                            \/* Disable emitting declarations that have `@internal` in their JSDoc comments. *\/\n    \/\/ \"noEmitHelpers\": true,                            \/* Disable generating custom helper functions like `__extends` in compiled output. *\/\n    \/\/ \"noEmitOnError\": true,                            \/* Disable emitting files if any type checking errors are reported. *\/\n    \/\/ \"preserveConstEnums\": true,                       \/* Disable erasing `const enum` declarations in generated code. *\/\n    \/\/ \"declarationDir\": \".\/\",                           \/* Specify the output directory for generated declaration files. *\/\n    \/\/ \"preserveValueImports\": true,                     \/* Preserve unused imported values in the JavaScript output that would otherwise be removed. *\/\n\n    \/* Interop Constraints *\/\n    \/\/ \"isolatedModules\": true,                          \/* Ensure that each file can be safely transpiled without relying on other imports. *\/\n    \/\/ \"allowSyntheticDefaultImports\": true,             \/* Allow 'import x from y' when a module doesn't have a default export. *\/\n    \"esModuleInterop\": true,                             \/* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. *\/\n    \/\/ \"preserveSymlinks\": true,                         \/* Disable resolving symlinks to their realpath. This correlates to the same flag in node. *\/\n    \"forceConsistentCasingInFileNames\": true,            \/* Ensure that casing is correct in imports. *\/\n\n    \/* Type Checking *\/\n    \"strict\": true,                                      \/* Enable all strict type-checking options. *\/\n    \/\/ \"noImplicitAny\": true,                            \/* Enable error reporting for expressions and declarations with an implied `any` type.. *\/\n    \/\/ \"strictNullChecks\": true,                         \/* When type checking, take into account `null` and `undefined`. *\/\n    \/\/ \"strictFunctionTypes\": true,                      \/* When assigning functions, check to ensure parameters and the return values are subtype-compatible. *\/\n    \/\/ \"strictBindCallApply\": true,                      \/* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. *\/\n    \/\/ \"strictPropertyInitialization\": true,             \/* Check for class properties that are declared but not set in the constructor. *\/\n    \/\/ \"noImplicitThis\": true,                           \/* Enable error reporting when `this` is given the type `any`. *\/\n    \/\/ \"useUnknownInCatchVariables\": true,               \/* Type catch clause variables as 'unknown' instead of 'any'. *\/\n    \/\/ \"alwaysStrict\": true,                             \/* Ensure 'use strict' is always emitted. *\/\n    \/\/ \"noUnusedLocals\": true,                           \/* Enable error reporting when a local variables aren't read. *\/\n    \/\/ \"noUnusedParameters\": true,                       \/* Raise an error when a function parameter isn't read *\/\n    \/\/ \"exactOptionalPropertyTypes\": true,               \/* Interpret optional property types as written, rather than adding 'undefined'. *\/\n    \/\/ \"noImplicitReturns\": true,                        \/* Enable error reporting for codepaths that do not explicitly return in a function. *\/\n    \/\/ \"noFallthroughCasesInSwitch\": true,               \/* Enable error reporting for fallthrough cases in switch statements. *\/\n    \/\/ \"noUncheckedIndexedAccess\": true,                 \/* Include 'undefined' in index signature results *\/\n    \/\/ \"noImplicitOverride\": true,                       \/* Ensure overriding members in derived classes are marked with an override modifier. *\/\n    \/\/ \"noPropertyAccessFromIndexSignature\": true,       \/* Enforces using indexed accessors for keys declared using an indexed type *\/\n    \/\/ \"allowUnusedLabels\": true,                        \/* Disable error reporting for unused labels. *\/\n    \/\/ \"allowUnreachableCode\": true,                     \/* Disable error reporting for unreachable code. *\/\n\n    \/* Completeness *\/\n    \/\/ \"skipDefaultLibCheck\": true,                      \/* Skip type checking .d.ts files that are included with TypeScript. *\/\n    \"skipLibCheck\": true                                 \/* Skip type checking all .d.ts files. *\/\n  }\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u767a\u751f\u3057\u305f\u30a8\u30e9\u30fc webpack\u3067TypeScript\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u30d3\u30eb\u3068\u3057\u3088\u3046\u3068\u3057\u305f\u3068\u3053\u308d\u3001'tsconfig.json' is empty\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3002 $ npx webpack --config .\/webp [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5251,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[304,302,294],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/akamist.com\/blog\/wp-content\/uploads\/2022\/01\/icon_typescript.png","jetpack-related-posts":[{"id":5311,"url":"https:\/\/akamist.com\/blog\/archives\/5311","url_meta":{"origin":5177,"position":0},"title":"[webpack] DevServer\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b","date":"2022\u5e742\u67084\u65e5","format":false,"excerpt":"webpack\u3078DevSErver\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001\u4f5c\u6210\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7c21\u5358\u306b\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u2026","rel":"","context":"JavaScript","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5528,"url":"https:\/\/akamist.com\/blog\/archives\/5528","url_meta":{"origin":5177,"position":1},"title":"TypeScript: eslint\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b","date":"2022\u5e745\u670828\u65e5","format":false,"excerpt":"React + TypeScript (craete-react-app\u306f\u672a\u4f7f\u7528)\u306e\u74b0\u5883\u306beslin\u2026","rel":"","context":"\u672a\u5206\u985e","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4002,"url":"https:\/\/akamist.com\/blog\/archives\/4002","url_meta":{"origin":5177,"position":2},"title":"[Laravel, Vue.js] npm run hot\u3067EADDRINUSE\/ELIFECYCLE\u30a8\u30e9\u30fc","date":"2020\u5e743\u670829\u65e5","format":false,"excerpt":"## \u767a\u751f\u3057\u305f\u4e8b\u8c61 Laravel7 + Vue.js\u306e\u958b\u767a\u3067\u3001`npm run hot`\u3092\u5b9f\u884c\u3057\u305f\u2026","rel":"","context":"Laravel","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4736,"url":"https:\/\/akamist.com\/blog\/archives\/4736","url_meta":{"origin":5177,"position":3},"title":"webpack\u304b\u3089eslint\u3092\u5b9f\u884c\u3059\u308b\u3068\u30a8\u30e9\u30fcTypeError: Cannot read property 'getFormatter' of undefined\u304c\u51fa\u308b","date":"2021\u5e7411\u670820\u65e5","format":false,"excerpt":"## \u767a\u751f\u3057\u305f\u4e8b\u8c61 webpack\u306beslint\u306e\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u3001`yarn run webpack`\u2026","rel":"","context":"\u672a\u5206\u985e","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5215,"url":"https:\/\/akamist.com\/blog\/archives\/5215","url_meta":{"origin":5177,"position":4},"title":"\u30a8\u30e9\u30fc: Field 'browser' doesn't contain a valid alias configuration\u304c\u51fa\u308b\u6642[React]","date":"2022\u5e741\u670820\u65e5","format":false,"excerpt":"## \u767a\u751f\u3057\u305f\u30a8\u30e9\u30fc React\u3067tsx\u30d5\u30a1\u30a4\u30eb\u3092import\u3057\u3088\u3046\u3068\u3057\u305f\u3089\u3001webpack\u306e\u30d3\u30eb\u30c9\u2026","rel":"","context":"\u672a\u5206\u985e","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5525,"url":"https:\/\/akamist.com\/blog\/archives\/5525","url_meta":{"origin":5177,"position":5},"title":"StoryBook\u3067\u30a8\u30e9\u30fcModule not found: Error: Can't resolve\u304c\u51fa\u308b\u3068\u304d","date":"2022\u5e745\u670828\u65e5","format":false,"excerpt":"## \u30a8\u30e9\u30fc\u5185\u5bb9 storybook\u3067`start-storybook -p 6006 -s pub\u2026","rel":"","context":"JavaScript","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts\/5177"}],"collection":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/comments?post=5177"}],"version-history":[{"count":6,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts\/5177\/revisions"}],"predecessor-version":[{"id":5183,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts\/5177\/revisions\/5183"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/media\/5251"}],"wp:attachment":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/media?parent=5177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/categories?post=5177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/tags?post=5177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}