Giter VIP home page Giter VIP logo

gatsby-plugin-stylable's Introduction

gatsby-plugin-stylable

npm

Gatsby plugin for enabling wix/stylable support.

Install

npm install --save gatsby-plugin-stylable

How to use

Just install this plugin and enable it in your gatsby-config.js.

// gatsby-config.js

module.exports = {
  plugins: [`gatsby-plugin-stylable`],
}

If you have any other plugins that add CSS loaders to your Webpack config, make sure to place this plugin after them.

If you want to configure @stylable/webpack-plugin, you may pass additional configuration options as shown below (the default configuration is shown):

// gatsby-config.js

module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-stylable`,
      options: {
        experimentalHMR: false,
        optimize: {
          classNameOptimizations: false,
          shortNamespaces: false,
        },
      },
    },
  ],
}

NOTE: optimize.classNameOptimizations and optimize.shortNamespaces are disabled since they will break production builds. Re-enable them at your own risk.

Options

This plugin support any configuration options available to @stylable/webpack-plugin. For a full list, see here.

License

Copyright © 2019 Aaron Ross. Use of this project is governed by an ISC license.

gatsby-plugin-stylable's People

Contributors

dependabot[bot] avatar melanieseltzer avatar superhawk610 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

melanieseltzer

gatsby-plugin-stylable's Issues

Remove "stylable" from peerDependencies

It's really great to see this plugin working, and people using it!

I just noticed that you reference the stylable package in your package.json under peerDependencies. You should remove it, as it references an old package, before we moved to a scoped organization on npm. It's not needed there regardless..

Keep up the great work. :)

Style not loading on index after deployment

I've installed the plugin and all works fine on localhost, but as soon as I deploy the site using Netlify and refresh the url no style is loaded. I've noticed that also when I navigate to another page, all the styles load fine and even work when I come back on the first page. However, as soon as I refresh the page, styles are gone again.

Here's the the link to the site https://miadori-staging.netlify.com

I've added you to the repo in case you want to check the code. Let me know if you could help.
Thank you

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.