GithubHelp home page GithubHelp logo

Comments (7)

istarkov avatar istarkov commented on May 22, 2024

Can you provide Example - what the need of allChunks options?

The only issue I know in current instance per module solution is I need to combine css manually as like here https://github.com/istarkov/react-components-markdown/blob/master/package.json#L9

cat *.css > combined.css

Please explain what the problem with allChunks: true? (I don't understand this option)

I can't use single webpack instance, please read comment here https://github.com/istarkov/babel-plugin-webpack-loaders/blob/master/src/runWebPackSync.js#L16

(It's possible to use single instance with fibers and like library - as at this fork https://github.com/morlay/babel-plugin-webpack-loaders-inline-exports but I prefer not to use such hacks)

from babel-plugin-webpack-loaders.

seeden avatar seeden commented on May 22, 2024

I created webpack loader and plugin translate-maker-loader for locales (i18n).
The functionality is very similar to css modules.
The main idea is to combine files like

locale/en_US.js

export default {
  next: 'Next',
  onlyInEnglish: 'Only in english',
}

and

locale/sk_SK.js

export default {
  next: 'Dalej',
  onlyInSlovak: 'Only in slovak',
}

into the file via your plugin (example of the loader output)

module.exports = {
  moduleName__next: {
    next: 'moduleName__next'
  }
};

but at the end I need to extract and combine multiple language files via plugin and I am not able to use simple en_US.js > /final/en_US.js because I have something like this:

/final/en_US.js

module.exports = {
    moduleName__next: {
      next: 'Next',
      onlyInEnglish: 'Only in english',
      onlyInSlovak: 'Only in slovak'
    }
}

I am storing all data from the loader into the plugin during the process.
And it is not possible in this moment because I will always get locale only for the current module.

from babel-plugin-webpack-loaders.

istarkov avatar istarkov commented on May 22, 2024

Looks like it's impossible without some outer process store for loaders data with current solution.
Imho you can do this combine as some post step as like as with css above. Because I can't use single webpack instance because of sync-async problems.

from babel-plugin-webpack-loaders.

seeden avatar seeden commented on May 22, 2024

I moved my plugin into the config file for the client(browser) bundle. There is the Webpack as "singleton".
Maybe you can write about this into the documentation too. Anyway thank you for the fast response.

from babel-plugin-webpack-loaders.

istarkov avatar istarkov commented on May 22, 2024

The problem with documentation that documentation does not exists for this project ;-)
All documentation is How it works + examples + tests + issues now

from babel-plugin-webpack-loaders.

seeden avatar seeden commented on May 22, 2024

indead :)

from babel-plugin-webpack-loaders.

istarkov avatar istarkov commented on May 22, 2024

Any product that needs a manual to work is broken. (c) Elon Musk

from babel-plugin-webpack-loaders.

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.