Giter Site home page Giter Site logo

Comments (8)

ColdHeat avatar ColdHeat commented on June 17, 2024 1

Hello can you please try 3.7.0? https://github.com/CTFd/CTFd/tree/3.7.0-dev. Webpack has been removed there and replaced with Vite.

from ctfd.

whirlwind110 avatar whirlwind110 commented on June 17, 2024

Hello can you please try 3.7.0? https://github.com/CTFd/CTFd/tree/3.7.0-dev. Webpack has been removed there and replaced with Vite.

@ColdHeat , thank you for your reply.

But it still failed after I changed the branch to 3.7.0-dev.

cd \CTFd\themes\admin
npm install
npx vite build

error1

Are some packages missed in package.json?

I added some packages like :

"echarts": "^4.9.0",
"event-source-polyfill": "^1.0.31",
"highlight.js": "^11.9.0",
"markdown-it": "^14.0.0",
"nunjucks": "^3.2.4",

Then the jquery error occurred, Rollup failed to resolve import "jquery" from "../core/assets/js/utils.js".

error2

from ctfd.

whirlwind110 avatar whirlwind110 commented on June 17, 2024

Finally, I have added packages and delete the first line in /core/assets/js/utils.js.

CTFd/themes/admin/package.json

"echarts": "^4.9.0",
"event-source-polyfill": "^1.0.31",
"highlight.js": "^11.9.0",
"jquery": "^3.7.1",
"markdown-it": "^14.0.0",
"nunjucks": "^3.2.4",
"q": "^1.5.1",
"sass": "^1.70.0",

CTFd/themes/core/assets/js/utils.js
delete the first line import $ from "jquery";

from ctfd.

ColdHeat avatar ColdHeat commented on June 17, 2024

Try using yarn, the admin theme builds for me.

from ctfd.

whirlwind110 avatar whirlwind110 commented on June 17, 2024

Try using yarn, the admin theme builds for me.

I found the reason.

A part of dependencies are defined in the root package.json. So we should execute yarn install in the root path firstly, then change the directory to \CTFd\CTFd\themes\admin and execute yarn install && yarn build.

Shall we merge the root package.json into admin theme folder?

from ctfd.

ColdHeat avatar ColdHeat commented on June 17, 2024

Yes thank you for digging, I just noticed this too. The ideal situation is admin being it's own seperate theme so we need to merge package.json into the admin theme, however we don't want to take everything, just the relevant packages. If you like you can PR that in but I will also take a look when I have the time.

from ctfd.

ColdHeat avatar ColdHeat commented on June 17, 2024

Interestingly for some reason in a fresh codespace this does build but I assume it is simply skipping those missing dependencies.

from ctfd.

ColdHeat avatar ColdHeat commented on June 17, 2024

Ah I see it actually was my mistake!

from ctfd.

Related Issues (20)

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.