Home

Issue: 3140

Error in examples/with-purgecss

[issue link]

Hi Guys,

first of all you rule!!

I’m trying to use purgecss with tailwind and have cloned this repo and changed directories to /with-purgecss then ran the following and get an error. I’d like to get it to work to convince myself the setup works with purgecss and tailwind as I’ve tried all sorts of things without luck on my actual project.

yarn && yarn dev
yarn install v1.5.1
warning package.json: No license field
warning example-with-purgecss: No license field
[1/4] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.91s.
yarn run v1.5.1
warning package.json: No license field
$ nuxt
/Users/apple/Documents/github/nuxt.js/examples/with-purgecss/nuxt.config.js:1
(function (exports, require, module, __filename, __dirname) { import path from 'path'
                                                              ^^^^^^

SyntaxError: Unexpected token import
    at new Script (vm.js:51:7)
    at createScript (vm.js:136:10)
    at Object.runInThisContext (vm.js:197:10)
    at Module._compile (module.js:626:28)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
    at Function.Module._load (module.js:507:3)
    at Module.require (module.js:606:17)
    at require (internal/module.js:11:18)
    at exports.loadNuxtConfig.argv (/Users/apple/Documents/github/nuxt.js/examples/with-purgecss/node_modules/nuxt/bin/common/utils.js:18:15)
    at Object.<anonymous> (/Users/apple/Documents/github/nuxt.js/examples/with-purgecss/node_modules/nuxt/bin/nuxt-dev:63:20)
    at Module._compile (module.js:662:30)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c nuxt
Directory: /Users/apple/Documents/github/nuxt.js/examples/with-purgecss
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/Users/apple/Documents/github/nuxt.js/examples/with-purgecss/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
This question is available on Nuxt.js community (#c2720)