Giter Site home page Giter Site logo

Comments (6)

denis-gorin avatar denis-gorin commented on June 11, 2024 1

first of all may be this is not a right way, because I run module after webpack build
but it suites for me, well, just follow this instructions
https://www.npmjs.com/package/on-build-webpack2
in combination with sync usage of rcs module
the result in my webpack config:

const WebpackOnBuildPlugin = require('on-build-webpack2');
const rcs = require('rename-css-selectors');

// ...

    plugins: [
      // ...
      new WebpackOnBuildPlugin(function(stats) {
        // Do whatever you want... Exactly:
        rcs.loadMapping('./renaming_map.json');
        let options = {
          overwrite: true,
          newPath: path.resolve(__dirname)
        }
        try {
          rcs.process.autoSync(['./public/**/*.js', './public/**/*.html', './public/**/*.css'], options);
          rcs.generateMappingSync('./', { overwrite: true });
        } catch (err) {
          console.error(err);
        }
      }),
      // ...
    ]

// ...

PS
there is only one problem with tilda:

.someSelector~.anotherSelector {
  // ... some css_rules
}

PPS

Quick workaround for this is to use predefined rule in renaming_map.json

".someSelector": "xx",
".someSelector~": "xx ~",

from node-rename-css-selectors.

JPeer264 avatar JPeer264 commented on June 11, 2024

Hey @fzp01717, thanks for your issue. I am not very experienced in neither laravel-mix nor webpack. Maybe @klimashkin does know a way using rcs with webpack.

from node-rename-css-selectors.

fzp01717 avatar fzp01717 commented on June 11, 2024

hello @JPeer264 thanks for your quick response :) . I will wait for @klimashkin comment then.

Thank you

from node-rename-css-selectors.

denis-gorin avatar denis-gorin commented on June 11, 2024

@fzp01717,
I integrate this module thru on-build-webpack2 plugin

from node-rename-css-selectors.

fzp01717 avatar fzp01717 commented on June 11, 2024

Thank you so much @denis-gorin. I will check it out. 😊

from node-rename-css-selectors.

JPeer264 avatar JPeer264 commented on June 11, 2024

@denis-gorin thanks for this plugin. Can you tell me how this works? I can add it to the README with a small description on how to use this lib with webpack.

from node-rename-css-selectors.

Related Issues (20)

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.