regularjs-loader
0.1.0 • Public • Published regularjs-loader ![npm package](https://img.shields.io/npm/v/regularjs-loader.svg?style=flat-square)
webpack loader for regularjs
Here is a simple example using regularjs-loader check it out
Installation
Usage
webpack.config.js
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: './index.js',
module: {
loaders: [
{
test: /\.rgl$/,
loader: 'regularjs'
}
]
},
regularjs: {
loaders: {
css: ExtractTextPlugin.extract( 'css' ),
mcss: ExtractTextPlugin.extract( 'css!mcss' )
}
},
plugins: [
new ExtractTextPlugin( 'app.css' )
]
};
index.js
import App from './App.rgl';
new App().$inject( document.body );
App.rgl
<style>
html {
background-color: #F2F2F2;
}
</style>
<style lang="mcss" scoped>
.outter {
.inner {
color: #000;
}
}
</style>
<template>
<div class="outter">
<div class="inner">RegularJs is Awesome <Button text="get it"></Button></div>
</div>
</template>
<script>
import Button from './Button.rgl';
export default {
components: {
'Button': Button,
},
init() {
console.log( 'App' );
}
}
</script>
Button.rgl
<template>
<button>{ text }</button>
</template>
<script>
import Base from 'path/to/Base.rgl';
export default Base.extend({
init() {
console.log( 'Button' );
}
});
</script>
Try it out!
Related
Thanks
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 0.1.0
1
Version History
Package Sidebar
Install
Weekly Downloads