Skip to content

Commit

Permalink
Merge pull request #1 from tamakiii-sandbox/init
Browse files Browse the repository at this point in the history
  • Loading branch information
tamakiii authored Oct 23, 2023
2 parents 9279396 + 4409158 commit 9878bbc
Show file tree
Hide file tree
Showing 13 changed files with 7,836 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
"@babel/preset-env"
]
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules/
/dist/
70 changes: 70 additions & 0 deletions .yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"ajv-sandbox": {
"configuration": {
"config": {
"topScope": [
"const webpack = require('webpack')",
"const path = require('path')",
"\n",
"/*\n * SplitChunksPlugin is enabled by default and replaced\n * deprecated CommonsChunkPlugin. It automatically identifies modules which\n * should be splitted of chunk by heuristics using module duplication count and\n * module category (i. e. node_modules). And splits the chunks…\n *\n * It is safe to remove \"splitChunks\" from the generated configuration\n * and was added as an educational example.\n *\n * https://webpack.js.org/plugins/split-chunks-plugin/\n *\n */",
"/*\n * We've enabled UglifyJSPlugin for you! This minifies your app\n * in order to load faster and run less javascript.\n *\n * https://github.com/webpack-contrib/uglifyjs-webpack-plugin\n *\n */",
"const UglifyJSPlugin = require('uglifyjs-webpack-plugin');",
"\n"
],
"webpackOptions": {
"module": {
"rules": [
{
"include": [
"path.resolve(__dirname, 'src')"
],
"loader": "'babel-loader'",
"options": {
"plugins": [
"'syntax-dynamic-import'"
],
"presets": [
[
"'@babel/preset-env'",
{
"'modules'": false
}
]
]
},
"test": "/\\.js$/"
}
]
},
"entry": {
"app": "'./src/app.js'",
"cli": "'./src/cli.js'",
"api": "'./src/api'"
},
"output": {
"filename": "'[name].[chunkhash].js'"
},
"mode": "'development'",
"plugins": [
"new UglifyJSPlugin()"
],
"optimization": {
"splitChunks": {
"cacheGroups": {
"vendors": {
"priority": -10,
"test": "/[\\\\/]node_modules[\\\\/]/"
}
},
"chunks": "'async'",
"minChunks": 1,
"minSize": 30000,
"name": true
}
}
},
"configName": "config"
}
}
}
}
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

lint: tsconfig.json
npx tslint -p $^ "src/**/*.{ts,tsx}"

lint-fix: tsconfig.json
npx tslint -p $^ --fix "src/**/*.{ts,tsx}"

webpack: webpack.config.js package.json tsconfig.json tslint.json
npx nodemon $(foreach f,$^,--watch $f) --exec "npx webpack --mode development --watch --progress"

webpack-dev-server: webpack.config.js package.json tsconfig.json tslint.json
npx nodemon $(foreach f,$^,--watch $f) --exec "npx webpack-dev-server --host 0.0.0.0 --port 8888"

http-server:
npx http-server -p 8888 dist
Loading

0 comments on commit 9878bbc

Please sign in to comment.