Skip to content

Change: build less from source #11

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

Merged
merged 3 commits into from
Jan 26, 2022
Merged

Change: build less from source #11

merged 3 commits into from
Jan 26, 2022

Conversation

eight04
Copy link
Collaborator

@eight04 eight04 commented Jan 20, 2022

Fixes #5.

Current the submodule points to the latest master.

@tophf do you want to open a new issue for sourcemap? Actually, I'm not sure whether we have excluded source map calculation from less.

@eight04 eight04 requested a review from tophf January 20, 2022 18:24
@tophf
Copy link
Member

tophf commented Jan 20, 2022

I've tried using sourcemaps in usercss-compiler.js:

      const res = await less.render(varDefs + source, {
        math: 'parens-division',
        sourceMap: {sourceMapFileInline: true},
      });

but I get "e.getSourceMapGenerator is not a function" both in current less and this one.

Other than that, the PR is probably fine because it works without sourcemaps.

@eight04 eight04 merged commit f10bd9f into master Jan 26, 2022
@eight04 eight04 deleted the dev-less-source branch January 26, 2022 08:59
@tophf
Copy link
Member

tophf commented Jan 26, 2022

What about bumping the version?

@eight04
Copy link
Collaborator Author

eight04 commented Jan 26, 2022

Tagged as 0.2.0

@tophf
Copy link
Member

tophf commented Jan 26, 2022

NPM doesn't download the new version for me even if I clear its cache manually.
Looking at package-lock.json (in Stylus) afterwards I see 0.2.0 but the url still points to the SHA of 0.1.0...
Publishing the bundle on npm would probably help.

@eight04
Copy link
Collaborator Author

eight04 commented Jan 26, 2022

We didn't publish this repo to npm. The code is fetched from Github directly:
https://github.com/openstyles/stylus/blob/f740686cb50d67b809bcfd581b37244a9fe1df0c/package.json#L16
In Stylus, we have to run:

npm install openstyles/less-bundle#v0.2.0

To switch to v0.2.0.

@tophf
Copy link
Member

tophf commented Jan 26, 2022

Isn't this what NPM does when I run npm install? I've already edited package.json to openstyles/less-bundle#v0.2.0

@eight04
Copy link
Collaborator Author

eight04 commented Jan 26, 2022

Isn't this what NPM does when I run npm install? I've already edited package.json to openstyles/less-bundle#v0.2.0

Seems like a bug in npm:
npm/cli#2844

BTW I found that we accidentally used a prod dependency:

less-bundle/package.json

Lines 44 to 46 in 42c7eb5

"dependencies": {
"@rollup/plugin-json": "^4.1.0"
}

Let me fix it and tag a new version.

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

Successfully merging this pull request may close these issues.

Update LESS
2 participants