View module.sass
// input
@include module('alert', (
component('icon'): (
margin-right: 0.5em,
line-height: 1.25,
modifier('close'): (
cursor: pointer
),
// same as above
View get-param.scss
/// Get parmater from config string
///
/// @author [@esr360](http://twitter.com/esr360)
/// @access public
///
/// @param {string} $string - the string from which to retrieve param
@function get-param($string) {
@if str-index($string, 'component("') == 1 {
$string: str-replace($string, 'component("', '');
$string: str-replace($string, '")', '');
View alert.jsx
import defaults from './alert.json';
/**
* Render Alert component
*
* @prop {String} name
* @prop {String} alert
* @prop {Bool} bar
* @prop {Bool} box
* @prop {(Bool|Array} icon
View thing3.jsx
<Alert success bar withWrapper />
<Alert success bar withWrapper />
<Alert success bar />
//
<Alert wrapper>
<Alert success bar />
<Alert success bar />
</Alert>
View sweet.html
<Wrapper>
<Button>Button</Button>
</Wrapper>
<Wrapper>
<Alert bar success>Alert Bar</Alert>
</Wrapper>
// Output:
View alert.jsx
/*
* USAGE:
* <Alert modifiers={['jizz']} alert='success' icon={['times', 'right']}>Alert Bar 2</Alert>
*
* Output:
* <div class="alert-jizz-bar-success"><div class="alert_icon-right fa fa-times"></div>Alert Bar 2</div>
*/
import defaults from './alert-bar.json';
View webpack.config.js
import path from 'path';
import webpack from 'webpack';
export default function(env) {
const target = env.target || 'node';
const entry = (target === 'node') ? {'synergy': './src/index.js'} : {
'synergy.web': './src/js/synergy.js',
'synergy.web.min': './src/js/synergy.js',
View preference.js
if (staticBuild) {
plugins.push(StaticSiteGenerator);
} else {
plugins.push(
new HtmlWebpackPlugin({
template: 'src/views/layouts/foo.jsx',
inject: false
})
)
}
View webpack.config.messy.js
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const StyleLintPlugin = require('stylelint-webpack-plugin');
const StaticSiteGeneratorPlugin = require('static-site-generator-webpack-plugin');
const WriteFilePlugin = require('write-file-webpack-plugin');
const jsdom = require('jsdom-global')();
import { Module, Component } from '../../Synergy/src/js/synergy';
View webpack.config.js
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: {
app: [
'webpack/hot/dev-server',
'webpack-hot-middleware/client',
'./src/app.js'
]