Socket
Socket
Sign inDemoInstall

@jitl/linaria-typescript-babel-repro

Package Overview
Dependencies
423
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @jitl/linaria-typescript-babel-repro

Reproduces https://github.com/callstack/linaria/issues/612


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Reproduces https://github.com/callstack/linaria/issues/612

My project is a large Typescript codebase that does not use --esModuleInterop. That means that in our source files, the import syntax for a commonjs module with a single export is import * as singleExport from 'module-name'. The babel equivalent of that import configuration is to use ["@babel/plugin-transform-modules-commonjs", { noInterop: true }].

However, Linaria always forces that babel plugin, but with the default options: noInterop: false. When our code is pre-processed with @babel/plugin-transform-modules-commonjs, the result of the import statement is now some unexpected value, instead of the chroma function.

Instructions

  1. npm install
  2. ./node_modules/.bin/webpack

You can modify ./src/client/main.tsx to enable or disable the error to verify that chroma "works" during normal script execution.

Check out also linaria.config.js for some other explanation.

FAQs

Last updated on 24 May 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc