Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@linaria/rollup does not support resolve.alias option from configuration. #888

Closed
mgcrea opened this issue Dec 17, 2021 · 1 comment
Closed
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked bundler: rollup 🗞️ Issue is related to rollup bundler cat: modules aliasing 🔗 Issue related to modules aliasing needs: complete repro 🖥️ Issue need to have complete repro provided

Comments

@mgcrea
Copy link

mgcrea commented Dec 17, 2021

Environment

  • Linaria version: "^3.0.0-beta.15"
  • Bundler (+ version): vite@^2.7.3"
  • Node.js version: 16
  • OS: macOS

Description

I'm using vite (that wraps rollup) to bundle my react app.

In my vite.config.js I have the following alias that enables src/ absolute imports accross the app.

  resolve: {
    alias: [
      {
        find: 'src',
        replacement: resolve(ROOT_DIR, 'src'),
      },
    ],
  },

Unfortunately linaria does not seem to leverage this to properly resolve these aliased absolute paths:

Tried to tweak the linaria.config.js without luck:

const {resolve} = require('path');

module.exports = {
  evaluate: true,
  displayName: true,
  babelOptions: {
    presets: ['@babel/preset-react', '@babel/preset-typescript'],
  },
  resolveOptions: {
    alias: [
      {
        find: 'src',
        replacement: resolve(__dirname, 'src'),
      },
    ],
  },
};
@mgcrea mgcrea added bug report 🦗 Issue is probably a bug, but it needs to be checked needs: complete repro 🖥️ Issue need to have complete repro provided needs: triage 🏷 Issue needs to be checked and prioritized labels Dec 17, 2021
@github-actions github-actions bot added bundler: rollup 🗞️ Issue is related to rollup bundler cat: modules aliasing 🔗 Issue related to modules aliasing and removed needs: triage 🏷 Issue needs to be checked and prioritized labels Dec 17, 2021
@Anber
Copy link
Collaborator

Anber commented Jul 18, 2022

Fixed in #1004

@Anber Anber closed this as completed Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked bundler: rollup 🗞️ Issue is related to rollup bundler cat: modules aliasing 🔗 Issue related to modules aliasing needs: complete repro 🖥️ Issue need to have complete repro provided
Projects
None yet
Development

No branches or pull requests

2 participants