Skip to content
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

Browser usage is not supported at this time #22

Open
roelvanduijnhoven opened this issue Dec 28, 2015 · 5 comments
Open

Browser usage is not supported at this time #22

roelvanduijnhoven opened this issue Dec 28, 2015 · 5 comments

Comments

@roelvanduijnhoven
Copy link

My current situation does need this functionality. The LESS files are compiled on the client, and we use modifyVars after a settings is changed by the user.

Do you hava an idea how this library could theortically be extended for this to work? I would be willing to contribute.

As less.modifyVars does not return the result, but adapts the DOM, it is not easy to chain an autoprefix after it. A solution could be to look at the latest introduced <style> tag and autoprefix it. Howver that feels really hacky.

@lukeapage
Copy link
Member

lukeapage commented Dec 28, 2015 via email

@roelvanduijnhoven
Copy link
Author

Thanks for the input.

I bundled using:

browserify --standalone AutoprefixProcessor main.js -o bundle.js

And then registered as:

less.plugins = [
    new window.AutoprefixProcessor({
        browsers: ['> 0.5% in NL', 'last 3 versions', 'Firefox ESR']
    })
];

But gives no input.

Most likely related to version 1.7.2 of Less I am running. First need to upgrade that.

@lukeapage
Copy link
Member

lukeapage commented Dec 28, 2015 via email

@roelvanduijnhoven
Copy link
Author

Thanks for helping out. So we upgraded from the 1.7.2 release (which was long due ;))!

Using the dutch set does not work. It fails

Uncaught (in promise) Error: Cannot find module 'caniuse-db/region-usage-json/NL'

Even though I explicitly required it in my main.js file and the set seems to be present in the bundle:

var usage = require('caniuse-db/region-usage-json/NL');
module.exports = require('./lib/index.js');

The JS file that I build this way has a minimized file size of 1.2MB 😨

@roelvanduijnhoven
Copy link
Author

There is a clean solution for this now. That is using postcss using the less syntax. That we I can generate a autoprefixed LESS file that I serve to the front-end.

You +1 on closing this one @lukeapage?

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

No branches or pull requests

2 participants