Coder Social home page Coder Social logo

broccoli-autoprefixer's Introduction

broccoli-autoprefixer

Prefix CSS using Autoprefixer

Issues with the output should be reported on the Autoprefixer issue tracker.

Install

$ npm install --save-dev broccoli-autoprefixer

Usage

import Autoprefixer from 'broccoli-autoprefixer';

tree = new Autoprefixer(tree, options);

API

Autoprefixer(tree, options?)

options

Type: object

See the Autoprefixer options.

In addition, you can set this option:

sourcemap

Type: boolean
Default: true if the input has a sourcemap, otherwise false

Set to true to include a Base64-encoded sourcemap at the end of the output.

If a sourcemap already exists in the input, Autoprefixer will automatically include an updated sourcemap in the output. Set this value to false to strip out the sourcemap entirely.

If you'd like to extract the inline sourcemap from the output, consider using a tool like broccoli-source-map.

broccoli-autoprefixer's People

Contributors

alonski avatar duder-onomy avatar jamesreggio avatar kevinhinterlong avatar nlfurniss avatar richienb avatar sindresorhus avatar stefanpenner avatar tony2n2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

broccoli-autoprefixer's Issues

Inline source maps are not working

This issue was originally posted on autoprefixer but @ai instructed me to add it here.

I'm using broccoli-autoprefixer in an ember-cli project, and the source map is not working when autoprefixer is used. If I remove autoprefixer then the source maps work correctly.

  • ember-cli-sass is correctly producing an inline source map /*# sourceMappingURL=data:application/json;base64,...
  • I'm setting sourcemap: true when I call broccoli-autoprefixer
  • There is a sourceMappingURL included at the end of the CSS file, but it's broken: DevTools doesn't show the SCSS source, just the final output CSS

FWIW, I'd also like to add that I'd much prefer to be able to use a .map file, rather than having to embed the source map inline in the CSS file. The current beta of broccoli-sass (I'm a maintainer of broccoli-sass) uses sourcesContent to embed the source files into the source map, so this is quite a bit of data and I'd much prefer for the browser to be able to request the source map when it needs it, rather than it being force-fed inline in the CSS.

I can provide an example repo if this helps to debug the problem.

warning

I started getting this warning
Autoprefixer's process() method is deprecated and will removed in next major release. Use postcss([autoprefixer]).process() instead

Updating autoprefixer version and new minor release

Hello !

I wanted to contribute to this repo by making a PR to update autoprefixer to the 9.5.1 version, but it seems that I don't have the right to push a branch on this repo. Would it be possible just to update this package, to have the latest features of autofixer, and make a minor release of the package ?

We can pair, or discuss :)

Error when saving any file: ENOENT, no such file or directory

Ember: v2.1.0
Ember CLI: v1.13.8

(Cross-posted from kimroen/ember-cli-autoprefixer#25)

A build error is triggered when any files are saved after starting ember serve. This issue appears to be connected to the release of broccoli-autoprefixer v4.1.0.

The error is prevented if I force broccoli-autoprefixer v4.0.0, though this seems to have the unfortunate side effect of breaking livereload of styles. The only real "fix" during development is to temporarily disable autoprefixer entirely using autoprefixer: { enabled: false ... }.

I've been unsuccessful in tracking down what exactly this issue is, but I'd be happy to provide more information about my build if necessary.

ENOENT, no such file or directory '/Projects/Thing/ember/tmp/autoprefixer_filter-output_path-NncgYwdM.tmp/assets/old-ie.js'
Error: ENOENT, no such file or directory '/Projects/Thing/ember/tmp/autoprefixer_filter-output_path-NncgYwdM.tmp/assets/old-ie.js'
    at Error (native)
    at Object.fs.statSync (fs.js:797:18)
    at copyDereferenceSync (/Projects/Thing/ember/node_modules/ember-cli/node_modules/ember-cli-copy-dereference/index.js:13:21)
    at copyDereferenceSync (/Projects/Thing/ember/node_modules/ember-cli/node_modules/ember-cli-copy-dereference/index.js:31:7)
    at Function.copyDereferenceSync (/Projects/Thing/ember/node_modules/ember-cli/node_modules/ember-cli-copy-dereference/index.js:31:7)
    at /Projects/Thing/ember/node_modules/ember-cli/lib/models/builder.js:103:19
    at lib$rsvp$$internal$$initializePromise (/Projects/Thing/ember/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:541:9)
    at PromiseExt.lib$rsvp$promise$$Promise [as _superConstructor] (/Projects/Thing/ember/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:757:9)
    at new PromiseExt (/Projects/Thing/ember/node_modules/ember-cli/lib/ext/promise.js:32:8)
    at Class.module.exports.Task.extend.copyToOutputPath (/Projects/Thing/ember/node_modules/ember-cli/lib/models/builder.js:98:12)

upgrade to broccoli-persistent-filter

It's much faster the broccoli-filter, we have plans to upstream the work. @joliss is thinkin on how to elegantly incorporate some of the ideas. At which time, we will re-merge the two projects.

Given projects such as: https://gist.github.com/workmanw/fdf85772fb8e61bfbeb8
BPF will easily reduce the 86ms rebuild time to 5-10ms (or better)

If no one beats me to it, later this week I will try to make the update myself.

Some examples doing similar upgrade (maybe i get lucky and someone beats me to it):

How to use this plugin after compile sass

var appCss = compileSass(['styles'], 'app.scss', '/assets/app.css');
appCss = autoprefixer(appCss, {
  sourcemap: false,
  cascade: false
});

This is my code snippet, but it does not working properly.

Use Autoprefixer 3.0

Please, use autoprefixer-core, instead of autoprefixer npm package. Core package was cleaned from file system and CLI code and has no fs-extra dependency.

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.