-
Notifications
You must be signed in to change notification settings - Fork 2
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.bemrc.js support #20
Comments
You need specifically |
I need possibility to require it ;) |
We have two options to make it possible to browserify config:
|
Is it about magic before this config will be in code? How should it work? |
What about something like this:
|
@tadatuta could it be postinstall step ? |
@tadatuta it sounds good ;) |
After more consideration we end up with following solution. Each project should create custom script to run in build time. There should be something like this: const cfg = require('bem-config')();
const clientConfig = {
levelMap: cfg.levelMapSync(),
webpackBemLoader: cfg.moduleSync('webpack-bem-loader')
};
fs.writeFileSync('client-config.js', 'module.exports = ' + JSON.stringify(clientConfig) + ';'); |
another solution may be a usage of |
We need to use this one https://webpack.js.org/plugins/environment-plugin/ |
It will be awesome if we support
.bemrc.js
and the way to work with bem-config in commonJS modules witch will be browserified. It means we need support the way to work without critical dependencies, such as: fs, glob and etc. Only commonJS. It's required thing for bem-react-core. Yes, I know we can write some magic code for bundles and use in runtime, but it's not a better way, because it will be global objects :(The text was updated successfully, but these errors were encountered: