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

Cannot compile .scss into bundle.css #285

Open
aress31 opened this issue Jun 9, 2020 · 0 comments
Open

Cannot compile .scss into bundle.css #285

aress31 opened this issue Jun 9, 2020 · 0 comments

Comments

@aress31
Copy link

aress31 commented Jun 9, 2020

I spent the whole day Googling things such as "How to compile sass into css with Rollup and postcss". I have looked hundred of times at the documentation and code implementation, but I can't figure out how to compile all my .scss files under src/styles to dist/bundle.css and I have even less of a clue on how to configure my es-dev-server to allow me dynamically changing the files and re-bundling.

Could someone please advice on how to do?

This is what I managed to come up with but without a verbose option it is hard to debug and see what is wrong.

export default merge(baseConfig, {
  // if you use createSpaConfig, you can use your index.html as entrypoint,
  // any <script type="module"> inside will be bundled by rollup
  input: './index.html',
  plugins: [
    analyze(),
    postcss({
      use: ['sass'],
      plugins: [autoprefixer(), cssnano()],
      extract: true,
      modules: true,
      minimize: true,
      extensions: ['.scss', '.css'],
    }),
  ],

  // alternatively, you can use your JS as entrypoint for rollup and
  // optionally set a HTML template manually
  // input: './app.js',
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant