Add webpack to twenty-frontend/
This commit is contained in:
parent
d5f68b64ab
commit
061ad201c1
14 changed files with 5003 additions and 23 deletions
|
@ -1,2 +1,7 @@
|
|||
+.
|
||||
-.git/
|
||||
-twenty-frontend/build/
|
||||
-twenty-frontend/node_modules/
|
||||
-.gems/
|
||||
-crash.log
|
||||
|
||||
|
|
1
twenty-frontend/.gitignore
vendored
1
twenty-frontend/.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
build/
|
||||
node_modules/
|
||||
tmp/
|
||||
crash.log
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require "nanoc-webpack"
|
||||
compile("/layouts/*") { write(nil) }
|
||||
compile("/fonts/*.ttf") { write(item.identifier.to_s) }
|
||||
compile("/css/main.scss") do
|
||||
filter(:sass, syntax: :scss)
|
||||
filter(:rainpress)
|
||||
write("/css/main.css")
|
||||
end
|
||||
compile("/js/index.tsx") do
|
||||
filter(:webpack)
|
||||
write("/js/index.js")
|
||||
end
|
||||
compile '/**/*.html' do
|
||||
layout '/default.*'
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# A list of file extensions that Nanoc will consider to be textual rather than
|
||||
# binary. If an item with an extension not in this list is found, the file
|
||||
# will be considered as binary.
|
||||
text_extensions: [ 'adoc', 'asciidoc', 'atom', 'coffee', 'css', 'erb', 'haml', 'handlebars', 'hb', 'htm', 'html', 'js', 'less', 'markdown', 'md', 'ms', 'mustache', 'php', 'rb', 'rdoc', 'sass', 'scss', 'slim', 'tex', 'txt', 'xhtml', 'xml' ]
|
||||
text_extensions: [ 'adoc', 'asciidoc', 'atom', 'coffee', 'css', 'erb', 'haml', 'handlebars', 'hb', 'htm', 'html', 'js', 'less', 'markdown', 'md', 'ms', 'mustache', 'php', 'rb', 'rdoc', 'sass', 'scss', 'slim', 'tex', 'txt', 'xhtml', 'xml', 'ts', 'tsx' ]
|
||||
|
||||
prune:
|
||||
auto_prune: true
|
||||
|
|
4902
twenty-frontend/package-lock.json
generated
Normal file
4902
twenty-frontend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
20
twenty-frontend/package.json
Normal file
20
twenty-frontend/package.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "twenty",
|
||||
"dependencies": {
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"classnames": "^2.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.0.18",
|
||||
"@types/react-dom": "^18.0.6",
|
||||
"eslint": "^8.26.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"prettier": "^2.7.1",
|
||||
"ts-loader": "^9.3.1",
|
||||
"ts-standard": "^12.0.1",
|
||||
"typescript": "^4.8.2",
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-cli": "^4.10.0"
|
||||
}
|
||||
}
|
1
twenty-frontend/src/css/_colors.scss
Normal file
1
twenty-frontend/src/css/_colors.scss
Normal file
|
@ -0,0 +1 @@
|
|||
$black: lighten(#000, 20%);
|
4
twenty-frontend/src/css/_fonts.scss
Normal file
4
twenty-frontend/src/css/_fonts.scss
Normal file
|
@ -0,0 +1,4 @@
|
|||
@font-face {
|
||||
font-family: "Dhurjati Regular";
|
||||
src: local("Dhurjati Regular"), url("/fonts/dhurjati-regular.ttf") format("truetype");
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
@import "fonts";
|
||||
@import "colors";
|
||||
|
||||
body {
|
||||
font-family: "Dhurjati Regular";
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
header {
|
||||
margin: 0 auto;
|
||||
width: 75%;
|
||||
max-width: 678px;
|
||||
h1 {
|
||||
color: $black;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-weight: normal;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
BIN
twenty-frontend/src/fonts/dhurjati-regular.ttf
Normal file
BIN
twenty-frontend/src/fonts/dhurjati-regular.ttf
Normal file
Binary file not shown.
0
twenty-frontend/src/js/index.tsx
Normal file
0
twenty-frontend/src/js/index.tsx
Normal file
|
@ -2,28 +2,12 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>A Brand New Nanoc Site - <%= @item[:title] %></title>
|
||||
<link rel="stylesheet" href="/stylesheet.css">
|
||||
|
||||
<!-- you don't need to keep this, but it's cool for stats! -->
|
||||
<meta name="generator" content="Nanoc <%= Nanoc::VERSION %>">
|
||||
<title>twenty</title>
|
||||
<link rel="stylesheet" href="/css/main.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
<%= yield %>
|
||||
</div>
|
||||
<div id="sidebar">
|
||||
<h2>Documentation</h2>
|
||||
<ul>
|
||||
<li><a href="https://nanoc.ws/doc/">Documentation</a></li>
|
||||
<li><a href="https://nanoc.ws/doc/tutorial/">Tutorial</a></li>
|
||||
</ul>
|
||||
<h2>Community</h2>
|
||||
<ul>
|
||||
<li><a href="http://groups.google.com/group/nanoc/">Discussion group</a></li>
|
||||
<li><a href="https://gitter.im/nanoc/nanoc">Gitter channel</a></li>
|
||||
<li><a href="https://nanoc.ws/contributing/">Contributing</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<header>
|
||||
<h1>twenty</h1>
|
||||
</header>
|
||||
</body>
|
||||
</html>
|
||||
|
|
17
twenty-frontend/tsconfig.json
Normal file
17
twenty-frontend/tsconfig.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"strictNullChecks": false,
|
||||
"module": "commonjs",
|
||||
"target": "ES2020",
|
||||
"noImplicitAny": true,
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"jsx": "react",
|
||||
"allowJs": true,
|
||||
"lib": [ "ES2020", "DOM" ],
|
||||
|
||||
"baseUrl": "src/",
|
||||
"paths": { "*": ["js/*"] },
|
||||
}
|
||||
}
|
20
twenty-frontend/webpack.config.js
Normal file
20
twenty-frontend/webpack.config.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
const path = require('path');
|
||||
const process = require('process');
|
||||
|
||||
module.exports = {
|
||||
mode: process.env.NODE_ENV || "development",
|
||||
resolve: {
|
||||
roots: [path.resolve('src/js'), path.resolve('node_modules')],
|
||||
modules: [path.resolve('src/js'), path.resolve('node_modules')],
|
||||
extensions: ['.js', '.ts', '.tsx']
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
Loading…
Reference in a new issue