Gatsby: webpack output.publicPath๋ฅผ ์„ค์ •ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

์— ๋งŒ๋“  2019๋…„ 06์›” 16์ผ  ยท  1๋…ผํ‰  ยท  ์ถœ์ฒ˜: gatsbyjs/gatsby

๊ธฐ์ˆ 

ํฌ๋กฌ ๊ฐœ๋ฐœ ๋„๊ตฌ์—์„œ ๋‚ด CSS blob์˜ ํŒŒ์ผ ์ด๋ฆ„์„๋ณด๊ณ  ์‹ถ์—ˆ์Šต๋‹ˆ๋‹ค.
image
์Šคํƒ€์ผ ๋กœ๋” readme ๋Š” output.publicPath webpack ์†์„ฑ์„ ์„ค์ •ํ•ด์•ผํ•œ๋‹ค๊ณ  ๋ช…์‹œํ•ฉ๋‹ˆ๋‹ค. gatsby-config.js๋ฅผ ํ†ตํ•ด ์„ค์ •ํ•˜๋ฉด gatsby develop ์‹คํŒจํ•ฉ๋‹ˆ๋‹ค.

์žฌํ˜„ ๋‹จ๊ณ„

gatsby-node.js :

  exports.onCreateWebpackConfig = ({ stage, rules, loaders, plugins, actions }) => actions.setWebpackConfig({
    output: {
      publicPath: '/',
    },
 });

์˜ˆ์ƒ ๊ฒฐ๊ณผ

๊ฒฝ๋กœ๋ฅผ ์„ค์ •ํ•ด์•ผํ•˜๋ฉฐ ๊ตฌ์„ฑํ•œ ์Šคํƒ€์ผ ๋กœ๋”์—์„œ ๋‚ด CSS ํŒŒ์ผ์— ๋Œ€ํ•ด ์ ˆ๋Œ€ ๊ฒฝ๋กœ๊ฐ€ ์ƒ์„ฑ๋˜์–ด์•ผํ•ฉ๋‹ˆ๋‹ค.

์‹ค์ œ ๊ฒฐ๊ณผ

> gatsby develop

success open and validate gatsby-configs - 0.058 s
success load plugins - 1.072 s
success onPreInit - 0.009 s
success initialize cache - 0.035 s
success copy gatsby files - 0.138 s
success onPreBootstrap - 0.026 s
success source and transform nodes - 0.087 s
success building schema - 0.349 s
success createPages - 0.004 s
success createPagesStatefully - 0.082 s
success onPreExtractQueries - 0.015 s
success update schema - 0.042 s
success extract queries from components - 0.157 s
success run static queries - 0.208 s โ€” 2/2 10.53 queries/second
success run page queries - 0.052 s โ€” 6/6 146.57 queries/second
success write out page data - 0.011 s
success write out redirect data - 0.008 s
success Build manifest and related icons - 0.411 s
success Build manifest and related icons - 0.014 s
success onPostBootstrap - 0.476 s
โ €
info bootstrap finished - 9.560 s
โ €
error There was an error compiling the html.js component for the development server.

See our docs page on debugging HTML builds for help https://gatsby.dev/debug-html


  Error: ./.cache/gatsby-browser-entry.js
  Module not found: Error: Can't resolve 'gatsby-link' in '/.../.cac
  he'
  resolve 'gatsby-link' in '/.../.cache'
    Parsed request is a module
   @ ./.cache/gatsby-browser-entry.js 3:0-112 42:0-45:64 42:0-45:64 42:0-45:64 42:0-45:64 42:0-45:64
  42:0-45:64 42:0-45:64 42:0-45:64
   @ ./node_modules/gatsby-plugin-manifest/gatsby-ssr.js
   @ ./.cache/api-runner-ssr.js

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] develop: `gatsby develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /.../.npm/_logs/2019-06-16T19_56_49_086Z-debug.log
error Command failed with exit code 1.

ํ™˜๊ฒฝ

์ฒด๊ณ„:
์šด์˜์ฒด์ œ : macOS High Sierra 10.13.6
CPU : (4) x64 Intel (R) Core (TM) i5-4260U CPU @ 1.40GHz
์…ธ : 5.6.2-/ usr / local / bin / zsh
๋ฐ”์ด๋„ˆ๋ฆฌ :
๋…ธ๋“œ : 10.15.2-/ usr / local / bin / node
์›์‚ฌ : 1.13.0-/ usr / local / bin / yarn
npm : 6.7.0-/ usr / local / bin / npm
์–ธ์–ด :
Python : 2.7.15-/ usr / local / bin / python
๋ธŒ๋ผ์šฐ์ € :
ํฌ๋กฌ : 74.0.3729.169
Safari : 12.1.1
npm ํŒจํ‚ค์ง€ :
๊ฐœ์ธ ๋น„ : ^ 2.8.6 => 2.8.6
๊ฐœ์ธ ๋น„ ์ด๋ฏธ์ง€ : ^ 2.1.2 => 2.1.2
gatsby-plugin-manifest : ^ 2.1.1 => 2.1.1
gatsby-plugin-offline : ^ 2.1.1 => 2.1.1
gatsby-plugin-react-helmet : ^ 3.0.12 => 3.0.12
gatsby-plugin-sass : ^ 2.0.11 => 2.0.11
gatsby-plugin-sharp : ^ 2.1.3 => 2.1.3
gatsby-plugin-typescript : ^ 2.0.15 => 2.0.15
๊ฐœ์ธ ๋น„ ์†Œ์Šค ํŒŒ์ผ ์‹œ์Šคํ…œ : ^ 2.0.38 => 2.0.38
๊ฐœ์ธ ๋น„ ๋ณ€์••๊ธฐ ๋‚ ์นด๋กœ์šด : ^ 2.1.21 => 2.1.21

question or discussion

>๋ชจ๋“  ๋Œ“๊ธ€

์•ˆ๋…•ํ•˜์„ธ์š” @wildeyes

์šฐ๋ฐœ์  ์ธ ํŒŒ์†์„ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด ๋ช‡ ๊ฐ€์ง€ ๊ตฌ์„ฑ ์˜ต์…˜์ด ์„ค์ •๋œ ๊ฒฝ์šฐ ๋ฌด์‹œ๋ฉ๋‹ˆ๋‹ค. ํŠนํžˆ ํ•ญ๋ชฉ, ์ถœ๋ ฅ, ๋Œ€์ƒ ๋˜๋Š” resolveLoader์— ๋Œ€ํ•œ ๋ชจ๋“  ๋ณ€๊ฒฝ ์‚ฌํ•ญ์€ ๋ฌด์‹œ๋ฉ๋‹ˆ๋‹ค.

https://www.gatsbyjs.org/docs/actions/#setWebpackConfig (์œ„์—์„œ ๋ฐœ์ทŒ)์— ์„ค๋ช… ๋œ๋Œ€๋กœ ๋‘ ๊ฐœ์˜ ํ‚ค ์„ค์ •์„ ์ง€์›ํ•˜์ง€ ์•Š์œผ๋ฉฐ output ๋„ ๊ทธ์ค‘ ํ•˜๋‚˜์ž…๋‹ˆ๋‹ค!

์ž ์‹œ์ด ๋ฌธ์ œ๋ฅผ ๋งˆ๋ฌด๋ฆฌํ•˜์ง€๋งŒ ์ด์™€ ๊ด€๋ จ๋œ ๋‹ค๋ฅธ ๋„์›€์ด ํ•„์š”ํ•˜๋ฉด ์–ธ์ œ๋“ ์ง€ ๋‹ค์‹œ ์—ด์–ด ์ฃผ์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰