Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

server/app.tsx에서 client 컴포넌트를 import 할 수 없는 문제 #4

Open
SoYoung210 opened this issue Oct 10, 2019 · 0 comments
Labels
✈️ SSR ssr 구현하며 발생했던 이슈들

Comments

@SoYoung210
Copy link
Owner

SoYoung210 commented Oct 10, 2019

image

Solve

module.exports = {
  target: 'node',
  name: 'server',
  node: false,
  entry: pathResolve(__dirname,'server/app.tsx'),
  output: {
    filename: 'server.bundle.js',
    path: pathResolve(__dirname, 'static'),
  },
  module: {
    rules: [
      {
        test: /\.(ts|tsx|js)?$/,
        exclude: /node_modules/,
        use: [
          {
            loader: 'babel-loader',
            options: babelConfig
          }
        ],
      }
    ],
  },
  resolve: {
    extensions: ['.ts', '.tsx', '.js']
  },
  externals: [nodeExternals()]
};

확장자 없이 file을 import하고 싶다면 꼭! resolve: extenstions 옵션을 추가해주어야 한다.

@SoYoung210 SoYoung210 added the ✈️ SSR ssr 구현하며 발생했던 이슈들 label Oct 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
✈️ SSR ssr 구현하며 발생했던 이슈들
Projects
None yet
Development

No branches or pull requests

1 participant