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

how to use the require syntax #2

Open
GabrielDelepine opened this issue Mar 21, 2018 · 5 comments
Open

how to use the require syntax #2

GabrielDelepine opened this issue Mar 21, 2018 · 5 comments

Comments

@GabrielDelepine
Copy link

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
Copy link

s1nz commented Apr 5, 2018

+1

@anyley
Copy link
Owner

anyley commented Apr 5, 2018

@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
Copy link

rodrigobacelli commented Jan 30, 2019

You can use by requiring the default export.

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

@McCauliflower
Copy link

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
Copy link

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

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

No branches or pull requests

6 participants