anyley / postcss-exclude-files

postcss plugin for exclude files from processing
https://www.npmjs.com/package/postcss-exclude-files
MIT License
3 stars 4 forks source link

how to use the require syntax #2

Open GabrielDelepine opened 6 years ago

GabrielDelepine commented 6 years ago

Hi

I have a little question How to use this module with the basic require('postcss-exclude-files') syntax ?

const excludeFiles = require('postcss-exclude-files') simply does not work. I am getting the following error TypeError: excludeFiles is not a function

In the readme file you load postcss-exclude-files from a path, not from the node_modules. Is it intentional? import excludeFiles from './app/lib/postcss-exclude-files'

Thanks

s1nz commented 6 years ago

+1

anyley commented 6 years ago

@GabrielDelepine @s1nz Hi! I'm using ES6/7 syntax for webpack config files. To do this, rename webpack.config.js files to webpack.config.babel.js | webpack.config.dev.babel.js | webpack.config.prod.babel.js

rodrigobacelli commented 5 years ago

You can use by requiring the default export.

const excludeFiles = require('postcss-exclude-files').default;

McCauliflower commented 5 years ago

I am using the vue.config.js to edit my webpack config so changing the name of the file is not an option and the const excludeFiles = require('postcss-exclude-files').default; solution does not work for me in this case.

cryptiklemur commented 3 years ago

This doesn't unfortunately work with next.js. Can you please remove the default export and move to module.exports