Skip to content

Commit 4e82d7f

Browse files
committed
added webpack and stylus infra
1 parent 4c911ea commit 4e82d7f

9 files changed

+3417
-1
lines changed

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# yorha
22
CSS based on Nier Automata's interface design language.
3+
4+
Written in Stylus.

Diff for: dist/yorha.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+20-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,24 @@
55
"repository": "https://github.com/metakirby5/yorha.git",
66
"author": "Ethan Chan <[email protected]>",
77
"license": "MIT",
8-
"homepage": "https://github.com/metakirby5/yorha"
8+
"homepage": "https://github.com/metakirby5/yorha",
9+
"scripts": {
10+
"start": "webpack-dev-server",
11+
"build": "stylus --compress -u ./node_modules/nib < src/main.styl > dist/yorha.css"
12+
},
13+
"dependencies": {
14+
"coffee-script": "^1.12.2",
15+
"css-loader": "^0.26.1",
16+
"html-webpack-plugin": "^2.26.0",
17+
"nib": "^1.1.2",
18+
"pug-html-loader": "^1.0.10",
19+
"style-loader": "^0.13.1",
20+
"stylint": "^1.5.9",
21+
"stylint-loader": "^1.0.0",
22+
"stylus": "^0.54.5",
23+
"stylus-loader": "^2.4.0",
24+
"webpack": "^1.14.0",
25+
"webpack-dev-server": "^1.16.2",
26+
"webpack-merge": "^2.3.1"
27+
}
928
}

Diff for: src/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This is only used to require the styles.
2+
3+
require('./main')

Diff for: src/index.pug

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//- The main HTML output.
2+
3+
title YoRHa
4+
5+
h1 YoRHa

Diff for: src/main.styl

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@import 'nib'
2+
3+
body
4+
background linear-gradient(top, white, black)

Diff for: stylint.json

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"blocks": {
3+
"expect": "never",
4+
"error": true
5+
},
6+
"brackets": {
7+
"expect": "never",
8+
"error": true
9+
},
10+
"colons": {
11+
"expect": "never",
12+
"error": true
13+
},
14+
"colors": {
15+
"expect": "always",
16+
"error": true
17+
},
18+
"commaSpace": {
19+
"expect": "always",
20+
"error": true
21+
},
22+
"commentSpace": {
23+
"expect": "always",
24+
"error": true
25+
},
26+
"cssLiteral": {
27+
"expect": "never",
28+
"error": true
29+
},
30+
"depthLimit": 4,
31+
"duplicates": false,
32+
"efficient": {
33+
"expect": "always",
34+
"error": true
35+
},
36+
"extendPref": {
37+
"expect": "@extends",
38+
"error": true
39+
},
40+
"globalDupe": false,
41+
"indentPref": {
42+
"expect": 2,
43+
"error": true
44+
},
45+
"leadingZero": {
46+
"expect": "always",
47+
"error": true
48+
},
49+
"mixed": {
50+
"expect": false,
51+
"error": true
52+
},
53+
"namingConvention": {
54+
"expect": "lowercase-dash",
55+
"error": true
56+
},
57+
"namingConventionStrict": {
58+
"expect": true,
59+
"error": true
60+
},
61+
"none": {
62+
"expect": "always",
63+
"error": true
64+
},
65+
"noImportant": true,
66+
"parenSpace": {
67+
"expect": "never",
68+
"error": true
69+
},
70+
"placeholders": false,
71+
"prefixVarsWithDollar": {
72+
"expect": "always",
73+
"error": true
74+
},
75+
"quotePref": {
76+
"expect": "single",
77+
"error": true
78+
},
79+
"reporterOptions": {
80+
"columns": ["lineData", "severity", "description", "rule"],
81+
"columnSplitter": " ",
82+
"showHeaders": false,
83+
"truncate": true
84+
},
85+
"semicolons": {
86+
"expect": "never",
87+
"error": true
88+
},
89+
"sortOrder": false,
90+
"stackedProperties": {
91+
"expect": "never",
92+
"error": true
93+
},
94+
"trailingWhitespace": {
95+
"expect": "never",
96+
"error": true
97+
},
98+
"universal": false,
99+
"valid": {
100+
"expect": true,
101+
"error": true
102+
},
103+
"zeroUnits": {
104+
"expect": "never",
105+
"error": true
106+
},
107+
"zIndexNormalize": {
108+
"expect": 10,
109+
"error": true
110+
},
111+
"maxErrors": false,
112+
"maxWarnings": false,
113+
"groupOutputByFile": true,
114+
"mixins": [],
115+
"exclude": ["node_modules/**/*"]
116+
}

Diff for: webpack.config.coffee

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
path = require 'path'
2+
webpack = require 'webpack'
3+
merge = require 'webpack-merge'
4+
HtmlWebpackPlugin = require 'html-webpack-plugin'
5+
6+
# Paths
7+
dir = (name) -> path.join __dirname, name
8+
SRC_PATH = dir 'src'
9+
BUILD_PATH = dir 'dist'
10+
11+
# The main config
12+
module.exports =
13+
# What file to start at
14+
entry: [path.join SRC_PATH, 'index.js']
15+
16+
# Where to output
17+
output:
18+
path: BUILD_PATH
19+
publicPath: '/'
20+
filename: '[name].js'
21+
22+
# Where to load modules from
23+
resolve:
24+
root: SRC_PATH
25+
modulesDirectories: ['node_modules']
26+
extensions: ['', '.styl', '.js']
27+
28+
# Stylus options
29+
stylus:
30+
use: [(require 'nib')()]
31+
32+
# Stylint options
33+
stylint:
34+
config: 'stylint.json'
35+
36+
# Module loading options
37+
module:
38+
# Linters, etc.
39+
preLoaders: [
40+
# Stylint
41+
test: /\.styl/
42+
loaders: ['stylint']
43+
]
44+
45+
# Files to load
46+
loaders: [
47+
# Pug
48+
test: /\.pug$/
49+
loaders: ['pug-html']
50+
,
51+
# Stylus
52+
test: /\.styl$/
53+
loaders: ['style', 'css', 'stylus']
54+
]
55+
56+
plugins: [
57+
# Generate HTML
58+
new HtmlWebpackPlugin
59+
template: path.join SRC_PATH, 'index.pug'
60+
61+
# Hot module replacement
62+
new webpack.HotModuleReplacementPlugin()
63+
]
64+
65+
devServer:
66+
# Serve publicly
67+
host: '0.0.0.0'
68+
69+
# No iframe
70+
inline: true
71+
72+
# Show progress
73+
progress: true
74+
75+
# Hot reloading
76+
hot: true
77+
78+
# Allow routing
79+
historyApiFallback: true
80+
81+
# Display options
82+
stats:
83+
# Don't show a bunch of chunk stats
84+
chunkModules: false
85+
86+
# Pretty colors
87+
colors: true

0 commit comments

Comments
 (0)