Ionic Vue enable scss

Hi all,

How can I enable scss as style lang on Ionic project?

<style lang="scss" scoped>

Official Vue documentation ([Using Pre-Processors | Vue Loader]) says that
webpack.config.js must be modified but the Ionic does not have this file.

npm install -D sass-loader node-sass

and

module.exports = {
  module: {
    rules: [
     
      // this will apply to both plain `.scss` files
      // AND `<style lang="scss">` blocks in `.vue` files
      {
        test: /\.scss$/,
        use: [
          'vue-style-loader',
          'css-loader',
          'sass-loader'
        ]
      }
    ]
  },
  // plugin omitted
}

Thanks in advance!!

All Vue 3 apps created with the CLI, including Ionic Vue starter apps, are pre-configured to handle CSS Pre-processors. All you need to do is install the corresponding webpack loaders first:

npm install -D sass-loader@^10 sass

See Working with CSS | Vue CLI for more information.

4 Likes