-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from Hi-Windom/0.3.37
0.3.37
- Loading branch information
Showing
11 changed files
with
196 additions
and
10 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,16 @@ | ||
<p align="center"> | ||
<img alt="Sillot" src="./app/stage/icon.png"> | ||
</p> | ||
|
||
<p align="center"> | ||
<a href="README.md">SiYuan</a> | <a href="README_zh_CN.md">思源</a> | ||
|
||
</p> | ||
|
||
## About | ||
|
||
Sillot (汐洛)是开发者友好、社区优先、彖乄驱动的思源笔记发行版(分支) | ||
|
||
<p align="center"> | ||
<img alt="Sillot" src="./.github/split.png"> | ||
</p> |
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
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
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
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
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
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,164 @@ | ||
const path = require("path"); | ||
const webpack = require("webpack"); | ||
const pkg = require("./package.json"); | ||
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | ||
const HtmlWebpackPlugin = require("html-webpack-plugin"); | ||
const { CleanWebpackPlugin } = require("clean-webpack-plugin"); | ||
const TerserPlugin = require("terser-webpack-plugin"); | ||
const BundleAnalyzerPlugin = | ||
require("webpack-bundle-analyzer").BundleAnalyzerPlugin; | ||
// https://juejin.cn/post/7028768162355085326 | ||
|
||
module.exports = (env, argv) => { | ||
return { | ||
mode: argv.mode || "development", | ||
watch: argv.mode !== "production", | ||
devtool: argv.mode !== "production" ? "eval" : false, | ||
target: "electron-renderer", | ||
output: { | ||
publicPath: "", | ||
filename: "[name].[chunkhash].js", | ||
path: path.resolve(__dirname, "stage/build/app"), | ||
}, | ||
entry: { | ||
main: "./src/index.ts", | ||
window: "./src/window/index.ts", | ||
}, | ||
resolve: { | ||
extensions: [ | ||
".ts", | ||
".js", | ||
".jsx", | ||
".tsx", | ||
".tpl", | ||
".scss", | ||
".png", | ||
".svg", | ||
], | ||
}, | ||
optimization: { | ||
minimize: true, | ||
minimizer: [ | ||
new TerserPlugin({ | ||
terserOptions: { | ||
format: { | ||
comments: false, | ||
}, | ||
}, | ||
extractComments: false, | ||
}), | ||
], | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.tpl/, | ||
include: [ | ||
path.resolve(__dirname, "src/assets/template/app/index.tpl"), | ||
path.resolve(__dirname, "src/assets/template/app/window.tpl"), | ||
], | ||
loader: "html-loader", | ||
options: { | ||
sources: false, | ||
}, | ||
}, | ||
{ | ||
test: /\.ts(x?)$/, | ||
include: [path.resolve(__dirname, "src")], | ||
use: [ | ||
{ | ||
loader: "ts-loader", | ||
}, | ||
{ | ||
loader: "ifdef-loader", | ||
options: { | ||
BROWSER: false, | ||
MOBILE: false, | ||
}, | ||
}, | ||
], | ||
}, | ||
{ | ||
test: /\.scss$/, | ||
include: [path.resolve(__dirname, "src/assets/scss")], | ||
use: [ | ||
{ | ||
loader: MiniCssExtractPlugin.loader, | ||
options: { | ||
publicPath: "../../", | ||
}, | ||
}, | ||
{ | ||
loader: "css-loader", // translates CSS into CommonJS | ||
}, | ||
{ | ||
loader: "sass-loader", // compiles Sass to CSS | ||
}, | ||
], | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: [ | ||
{ | ||
loader: "style-loader", | ||
}, | ||
{ | ||
loader: "css-loader", | ||
}, | ||
], | ||
}, | ||
{ | ||
test: /\.jsx?$/, | ||
include: path.join(__dirname, "src"), | ||
loader: "babel-loader", | ||
}, | ||
{ | ||
test: /\.woff$/, | ||
type: "asset/resource", | ||
generator: { | ||
filename: "../fonts/JetBrainsMono-Regular.woff", | ||
}, | ||
}, | ||
{ | ||
test: /\.(png|svg)$/, | ||
use: [ | ||
{ | ||
loader: "file-loader", | ||
options: { | ||
name: "[name].[ext]", | ||
outputPath: "../../", | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
plugins: [ | ||
new CleanWebpackPlugin({ | ||
cleanStaleWebpackAssets: false, | ||
cleanOnceBeforeBuildPatterns: [path.join(__dirname, "stage/build/app")], | ||
}), | ||
new webpack.DefinePlugin({ | ||
SIYUAN_VERSION: JSON.stringify(pkg.version), | ||
SIYUAN_ORIGIN_VERSION: JSON.stringify(pkg.syv), | ||
NODE_ENV: JSON.stringify(argv.mode), | ||
}), | ||
new MiniCssExtractPlugin({ | ||
filename: "base.[contenthash].css", | ||
}), | ||
new HtmlWebpackPlugin({ | ||
inject: "head", | ||
chunks: ["main"], | ||
filename: "index.html", | ||
template: "src/assets/template/app/index.tpl", | ||
}), | ||
new HtmlWebpackPlugin({ | ||
inject: "head", | ||
chunks: ["window"], | ||
filename: "window.html", | ||
template: "src/assets/template/app/window.tpl", | ||
}), | ||
new BundleAnalyzerPlugin(), | ||
], | ||
}; | ||
}; |
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
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