Skip to content

Commit 88674f1

Browse files
committed
demo
1 parent 3555387 commit 88674f1

File tree

7 files changed

+77
-0
lines changed

7 files changed

+77
-0
lines changed

demo/browser.js

Whitespace-only changes.

demo/components/Button/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import React from 'react';
2+
3+
export default _ => (
4+
<button/>
5+
);

demo/components/Page.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
3+
export default _ => (
4+
<html lang='en'>
5+
<head>
6+
<title>Universal demo</title>
7+
<link rel='stylesheet' href=''/>
8+
<script type='text/javascript' src=''></script>
9+
</head>
10+
<body></body>
11+
</html>
12+
);

demo/package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "demo",
3+
"version": "1.0.0",
4+
"description": "Universal usage example",
5+
"main": "worker.js",
6+
"scripts": {
7+
"compile": "webpack",
8+
"start": "node worker",
9+
"test": "echo \"Error: no test specified\" && exit 1"
10+
},
11+
"keywords": [
12+
"css-modules"
13+
],
14+
"author": "Alexey Litvinov",
15+
"license": "MIT"
16+
}

demo/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Universal usage example
2+
=======================

demo/webpack.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
'use strict';
2+
3+
const ExtractTextPlugin = require('extract-text-webpack-plugin');
4+
const path = require('path');
5+
6+
module.exports = {
7+
entry: path.resolve('browser.js'),
8+
9+
output: {
10+
filename: 'browser.js',
11+
path: path.resolve('static'),
12+
},
13+
14+
module: {
15+
loaders: [
16+
{
17+
test: /\.css$/i,
18+
loader: ExtractTextPlugin.extract('style', 'css?modules'),
19+
},
20+
],
21+
},
22+
23+
plugins: [
24+
new ExtractTextPlugin('result.css', {
25+
allChunks: true
26+
}),
27+
],
28+
};

demo/worker.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
3+
const express = require('express');
4+
const hook = require('css-modules-require-hook');
5+
const path = require('path');
6+
7+
const config = require('./package').config;
8+
const app = express();
9+
10+
app.use(express.static(path.join(__dirname, 'static')));
11+
12+
app.get('/', (req, res) => res.render('page'));
13+
14+
app.listen(config.port, _ => console.log(`listening ${config.port}`));

0 commit comments

Comments
 (0)