From 2c3a340987281f33f8310db0f64b09f0253af918 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Mon, 8 Mar 2021 10:44:06 +0900 Subject: [PATCH] Add raw-loader as a dependency --- frontend/global.d.ts | 3 +++ frontend/nuxt.config.js | 16 +++++++++++----- frontend/package.json | 1 + frontend/yarn.lock | 26 ++++++++++++++++++++++++-- 4 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 frontend/global.d.ts diff --git a/frontend/global.d.ts b/frontend/global.d.ts new file mode 100644 index 00000000..77fdc369 --- /dev/null +++ b/frontend/global.d.ts @@ -0,0 +1,3 @@ +declare module '*.txt' +declare module '*.jsonl' +declare module '*.csv' diff --git a/frontend/nuxt.config.js b/frontend/nuxt.config.js index 95aa0bdf..d09254bb 100644 --- a/frontend/nuxt.config.js +++ b/frontend/nuxt.config.js @@ -130,12 +130,18 @@ export default { */ publicPath: process.env.PUBLIC_PATH || '/_nuxt/', extend(config, ctx) { + // config.module.rules.push({ + // test: /\.(txt|csv|conll|jsonl)$/i, + // loader: 'file-loader', + // options: { + // name: '[path][name].[ext]' + // } + // }) config.module.rules.push({ - test: /\.(txt|csv|conll|jsonl)$/i, - loader: 'file-loader', - options: { - name: '[path][name].[ext]' - } + enforce: 'pre', + test: /\.(txt|csv|json|jsonl)$/, + loader: 'raw-loader', + exclude: /(node_modules)/ }) } } diff --git a/frontend/package.json b/frontend/package.json index ed7c94c7..1166ee7f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -61,6 +61,7 @@ "jest": "^26.1.0", "nodemon": "^2.0.4", "prettier": "^2.2.1", + "raw-loader": "^4.0.2", "stylus": "^0.54.7", "stylus-loader": "^3.0.2", "vue-jest": "^3.0.6" diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 2aea8f41..8e464f05 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -1912,7 +1912,7 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd" integrity sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ== -"@types/json-schema@^7.0.5": +"@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6": version "7.0.7" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== @@ -2572,6 +2572,11 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.1.tgz#b83ca89c5d42d69031f424cad49aada0236c6957" integrity sha512-KWcq3xN8fDjSB+IMoh2VaXVhRI0BBGxoYp3rx7Pkb6z0cFjYR9Q9l4yZqqals0/zsioCmocC5H6UvsGD4MoIBA== +ajv-keywords@^3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" + integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== + ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.2: version "6.12.3" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.3.tgz#18c5af38a111ddeb4f2697bd78d68abc1cabd706" @@ -2582,7 +2587,7 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.2: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^6.12.4: +ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -10152,6 +10157,14 @@ raw-body@2.4.0: iconv-lite "0.4.24" unpipe "1.0.0" +raw-loader@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-4.0.2.tgz#1aac6b7d1ad1501e66efdac1522c73e59a584eb6" + integrity sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA== + dependencies: + loader-utils "^2.0.0" + schema-utils "^3.0.0" + rc9@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/rc9/-/rc9-1.0.0.tgz#b72c6665d0cd5e1af2f59d8f2e9da81f6187f9a3" @@ -10693,6 +10706,15 @@ schema-utils@^1.0.0: ajv-errors "^1.0.0" ajv-keywords "^3.1.0" +schema-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.0.0.tgz#67502f6aa2b66a2d4032b4279a2944978a0913ef" + integrity sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA== + dependencies: + "@types/json-schema" "^7.0.6" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + semver-diff@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b"