Comments (6)
what exactly do you mean by "merged" layer?
from layers-loader.
for given example it would like:
.
└── merged-layer/
└── button/
└── core-components.js // export default class
└── custom-components.js // import Button from './core-components'; export default class
└── product-theme.js // import Button from './custom-components'; export default class
└── index.js // export Button as default from './product-theme';
└── index.css // styles from theme-reset/button/styles.less and product-theme/button/styles.less
from layers-loader.
app
.
└── app/
└── somewhere.js
import Button from 'merged-layer/button';
import 'merged-layer/button/index.css';
class SomeAppComponent extends React.Component {
// ...
return (
//...
<Button
icon="never-gonna-give-you-up.png"
onClick={doStuff}>
{'Click me'}
</Button>
//...
);
}
from layers-loader.
I'm not quite sure that it's possible at all. I mean you can't prebuild your layer standalone because you don't know about other layers.
from layers-loader.
I think @Guria means prebuilding layer with resolved #
-imports, so you can just require, for example, button
— and it will be already prebuilded with all layers. Maybe it's possible to prebuild layer with a separate entry point for each component? But what about other dependencies, for example, if some component uses moment
library — should it be bundled as well in this case?
from layers-loader.
@mistadikay yep, you are right. It should be some build tool which use layer array ([require('core-components'),require('theme-reset'),require('../custom-layer')]
) as input and generates merged layer by resolving #
-imports.
But what about other dependencies, for example, if some component uses moment library — should it be bundled as well in this case?
Of course not. Usual require
s should left as is. Hmm. It means we should somehow merge dependencies from layers too.
from layers-loader.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from layers-loader.