Fix some config files

This commit is contained in:
Florine W. Dekker 2020-06-07 12:24:40 +02:00
parent 31f09dcafa
commit 65a57c1528
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
3 changed files with 29 additions and 39 deletions

View File

@ -7,12 +7,12 @@ module.exports = grunt => {
default: ["dist/"],
},
copy: {
html: {
files: [{expand: true, cwd: "src/main/", src: "**/*.html", dest: "dist/"}]
},
css: {
files: [{expand: true, cwd: "src/main/", src: "**/*.css", dest: "dist/"}]
},
html: {
files: [{expand: true, cwd: "src/main/", src: "**/*.html", dest: "dist/"}]
},
},
focus: {
dev: {
@ -41,6 +41,24 @@ module.exports = grunt => {
overwrite: true
},
},
watch: {
css: {
files: ["src/main/**/*.css"],
tasks: ["copy:css"],
},
html: {
files: ["src/main/**/*.html"],
tasks: ["copy:html"],
},
js: {
files: ["src/main/**/*.js"],
tasks: ["webpack:dev", "replace:dev"],
},
link: {
files: ["node_modules/@fwdekker/*/dist/**"],
tasks: ["webpack:dev", "replace:dev"],
},
},
webpack: {
options: {
entry: "./src/main/js/index.js",
@ -68,24 +86,6 @@ module.exports = grunt => {
mode: "production",
},
},
watch: {
css: {
files: ["src/main/**/*.css"],
tasks: ["copy:css"],
},
html: {
files: ["src/main/**/*.html"],
tasks: ["copy:html"],
},
js: {
files: ["src/main/**/*.js"],
tasks: ["webpack:dev", "replace:dev"],
},
link: {
files: ["node_modules/@fwdekker/*/dist/**"],
tasks: ["webpack:dev", "replace:dev"],
},
},
});
grunt.loadNpmTasks("grunt-contrib-clean");
@ -99,24 +99,22 @@ module.exports = grunt => {
// Pre
"clean",
// Copy files
"copy:html",
"copy:css",
// Compile
"copy:html",
// Compile JS
"webpack:dev",
// Post
"replace:dev"
"replace:dev",
]);
grunt.registerTask("dev:server", ["dev", "focus:dev"]);
grunt.registerTask("deploy", [
// Pre
"clean",
// Copy files
"copy:html",
"copy:css",
"copy:html",
// Compile JS
"webpack:deploy",
// Post
"replace:deploy"
"replace:deploy",
]);
grunt.registerTask("default", ["dev"]);

View File

@ -17,18 +17,10 @@ $> npm ci
### Building
```shell script
# Build the template in `dist/` for development
# Build the tool in `dist/` for development
$> npm run dev
# Same as above, but automatically rerun it whenever files are changed
$> npm run dev:server
# Build the template in `dist/` for deployment
# Build the tool in `dist/` for deployment
$> npm run deploy
```
### Publishing
```shell script
# Log in to npm
$> npm login
# Push to npm
$> npm publish --access public
```

View File

@ -6,7 +6,7 @@
"browser": "dist/bundle.js",
"repository": {
"type": "git",
"url": "git@git.fwdekker.com:FWDekker/interlanguage-checker.git"
"url": "git@git.fwdekker.com:FWDekker/doomsday.git"
},
"private": true,
"scripts": {