Code Monkey home page Code Monkey logo

hexo-unocss's Introduction

hexo-unocss's People

Contributors

imba97 avatar

Watchers

 avatar

hexo-unocss's Issues

unocss configFile 不生效

@unocss/coreconfigFile 好像不会加载相应配置

参考源码使用 unconfig 可以获取到配置

import path from 'node:path'

import { createGenerator } from 'unocss'
import { loadConfig } from 'unconfig'

const { config } = await loadConfig({
  sources: {
    files: path.resolve(process.cwd(), 'uno/uno.config.ts')
  }
})

const generator = createGenerator(config)

const { css } = await generator.generate('text-red')

console.log(css)

nice

hexo-unocss ESM 报错

因为 unocss 只有 .mjshexo 运行时导入报错

ERROR Plugin load failed: hexo-unocss
Error [ERR_REQUIRE_ESM]: require() of ES Module D:\Projects\hexo-unocss-test\node_modules\unocss\dist\index.mjs not supported.
Instead change the require of D:\Projects\hexo-unocss-test\node_modules\unocss\dist\index.mjs to a dynamic import() which is available in all CommonJS modules.
    at req (D:\Projects\hexo-unocss-test\node_modules\hexo\dist\hexo\index.js:241:31)
    at D:\Projects\hexo-unocss-test\node_modules\hexo-unocss\dist\index.cjs:1:168
    at D:\Projects\hexo-unocss-test\node_modules\hexo\dist\hexo\index.js:249:20    at tryCatcher (D:\Projects\hexo-unocss-test\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (D:\Projects\hexo-unocss-test\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (D:\Projects\hexo-unocss-test\node_modules\bluebird\js\release\promise.js:604:18)
    at Promise._settlePromise0 (D:\Projects\hexo-unocss-test\node_modules\bluebird\js\release\promise.js:649:10)
    at Promise._settlePromises (D:\Projects\hexo-unocss-test\node_modules\bluebird\js\release\promise.js:729:18)
    at _drainQueueStep (D:\Projects\hexo-unocss-test\node_modules\bluebird\js\release\async.js:93:12)
    at _drainQueue (D:\Projects\hexo-unocss-test\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (D:\Projects\hexo-unocss-test\node_modules\bluebird\js\release\async.js:102:5)
    at Async.drainQueues (D:\Projects\hexo-unocss-test\node_modules\bluebird\js\release\async.js:15:14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.