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

Unable to watch the changes on the source CSS file once imported #1

Open
fengyuanchen opened this issue Sep 11, 2020 · 8 comments
Open
Assignees
Labels

Comments

@fengyuanchen
Copy link

Works fine for one time build, but not local dev server (e.g., the development mode of Webpack).

@unlight unlight self-assigned this Sep 11, 2020
@unlight
Copy link
Owner

unlight commented Sep 11, 2020

Looks like it's common problem of some other babel plugins.

babel/babel#11741

@fengyuanchen
Do you use webpack/babel-loader? Have you tried BABEL_DISABLE_CACHE=1?

@fengyuanchen
Copy link
Author

fengyuanchen commented Sep 12, 2020

I use this plugin in a TypeScript project:

module: {
  rules: [
    {
      test: /\.ts$/,
      use: [
        {
          loader: 'babel-loader',
          options: {
            plugins: [
              [
                'postcss',
                {
                  test: /\.css$/,
                  postcss: true,
                },
              ],
            ],
          },
        },
        {
          loader: 'ts-loader',
        },
      ],
    }
  ]
}

@fengyuanchen
Copy link
Author

@unlight
Copy link
Owner

unlight commented Sep 12, 2020

How is related ts-loader and babel-plugin?

@unlight unlight reopened this Sep 12, 2020
@fengyuanchen
Copy link
Author

Just see the config segment of Webpack's module I had provided.

@fengyuanchen
Copy link
Author

I import a css file into a ts file in my project:

// index.ts
import utils from 'utils.ts';
import style from 'index.css';

@unlight unlight added the babel label Jul 10, 2021
@unlight
Copy link
Owner

unlight commented Mar 21, 2022

@unlight
Copy link
Owner

unlight commented Mar 21, 2022

It does not work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants