tailwindlabs / discuss

A place to ask questions, get help, or share what you've built with Tailwind CSS.
MIT License
171 stars 9 forks source link

Vue Cli 3.0 reuse configuration file in component logic #173

Open seSze opened 6 years ago

seSze commented 6 years ago

Hi, I've created vue cli 3.0 app with tailwindcss inside. I would like to reuse configuration file in my component logic and as there is a new Webpack version (does not support mixing old modules with es6) it throws an error:

"export 'default' (imported as 'tailwind') was not found in '@root/tailwind.config'

I've tried to add this file to transpileDependencies in my vue.config.js but it takes no effect.

Any idea how to solve this?

adamwathan commented 6 years ago

Hey @SebSzcze, so I just tried it using a simple require statement and it seems to work.

Here's a demo repo:

https://github.com/adamwathan/vue-import-tailwind-config-demo/blob/master/src/App.vue#L12

seSze commented 6 years ago

I've created repo to demonstrate this: here is the file with require/import (tested both) statement https://github.com/SebSzcze/vue-cli-tailwind-demo/blob/master/src/utils/validators.js

when running vue-cli-service serve everything compiles down but then it throws this error when viewing app in browser

https://tppr.me/LzenU

seSze commented 6 years ago
npm -v 
6.2.0

node -v
v10.9.0