Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Adding note about browserslist config#8054

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
xabbuh merged 1 commit intosymfony:3.3fromweaverryan:browserslist
Jun 22, 2017
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletionsfrontend/encore/postcss.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,8 @@ Next, create a ``postcss.config.js`` file at the root of your project:
plugins: {
// include whatever plugins you want
// but make sure you install these via yarn or npm!

// add browserslist config to package.json (see below)
autoprefixer: {}
}
}
Expand All@@ -35,6 +37,29 @@ Then, Enable the loader in Encore!

That's it! The ``postcss-loader`` will now be used for all CSS, Sass, etc files.

Adding browserslist to package.json
-----------------------------------

The ``autoprefixer`` (and many other tools) need to know what browsers you want to
support. The best-practice is to configure this directly in your ``package.json``
(so that all the tools can read this):

.. code-block:: diff

{
+ "browserslist": [ "last 2 versions", "ios >= 8" ]
}

See `browserslist`_ for more details on the syntax.

.. note::

Encore uses `babel-preset-env`_, which *also* needs to know which browsers you
want to support. But this does *not* read the ``browserslist`` config key. You
must configure the browsers separately via :doc:`configureBabel() </frontend/encore/babel>`.

.. _`PostCSS`: http://postcss.org/
.. _`autoprefixing`: https://github.com/postcss/autoprefixer
.. _`linting`: https://stylelint.io/
.. _`browserslist`: https://github.com/ai/browserslist
.. _`babel-preset-env`: https://github.com/babel/babel-preset-env

[8]ページ先頭

©2009-2025 Movatter.jp