-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(compose-plugins): example for using compose plugin (#159)
- Loading branch information
Showing
6 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react' | ||
|
||
const style = require('./style.css') | ||
|
||
export default class RootPage extends React.Component { | ||
render() { | ||
return ( | ||
<div> | ||
<h1 className={style.h1}>Hello World</h1> | ||
</div> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const cssPlugin = require('@airy/maleo-css-plugin') | ||
const tsPlugin = require('@airy/maleo-typescript-plugin') | ||
const compose = require('@airy/maleo-compose-plugin') | ||
|
||
module.exports = compose([ | ||
[tsPlugin], | ||
[cssPlugin, { | ||
cssPluginOptions: { | ||
extractCss: { | ||
singleCssFile: true, | ||
}, | ||
cssLoader: { | ||
modules: true, | ||
localIdentName: '[path][name]__[local]--[hash:base64:5]' | ||
} | ||
} | ||
}] | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "compose-plugins", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "maleo dev", | ||
"build": "export NODE_ENV=production && maleo build", | ||
"start": "node .maleo/server.js" | ||
}, | ||
"dependencies": { | ||
"@airy/maleo": "^0.0.14", | ||
"@airy/maleo-compose-plugin": "^0.1.0", | ||
"@airy/maleo-css-plugin": "^0.1.3", | ||
"@airy/maleo-typescript-plugin": "^0.0.17", | ||
"react": "^16.8.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[ | ||
{ | ||
"path": "/", | ||
"page": "./RootPage" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.h1 { | ||
color: red; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"extends": "./node_modules/@airy/maleo-typescript-plugin/tsconfig.base.json", | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"rootDir": "." | ||
}, | ||
"include": [ | ||
"**/*.ts", | ||
"**/*.tsx", | ||
"*/.ts", | ||
"*/.tsx" | ||
] | ||
} |