Update build chain
This commit is contained in:
parent
2ee41c7d9e
commit
1dab4bd27f
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,4 +1 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
package-lock.json
|
|
||||||
package.json
|
|
||||||
webpack.config.js
|
|
||||||
|
42
Makefile
42
Makefile
@ -1,42 +0,0 @@
|
|||||||
AUTHOR := Thomas Lovén
|
|
||||||
CARD_TOOLS := $(PWD)/../card-tools
|
|
||||||
|
|
||||||
PACKAGE := $(shell basename $(CURDIR))
|
|
||||||
PACKAGE := $(PACKAGE:lovelace-%=%)
|
|
||||||
DOCKER_CMD:=docker run --rm -v $(CARD_TOOLS):/card-tools:ro -v $(PWD):/usr/src/$(PACKAGE) -w="/usr/src/$(PACKAGE)" node:11
|
|
||||||
|
|
||||||
build: setup
|
|
||||||
$(DOCKER_CMD) npm run build
|
|
||||||
|
|
||||||
dev: setup
|
|
||||||
$(DOCKER_CMD) npm run watch
|
|
||||||
|
|
||||||
setup: package.json package-lock.json webpack.config.js
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm package.json package-lock.json webpack.config.js
|
|
||||||
rm -r node_modules
|
|
||||||
rm $(PACKAGE).js
|
|
||||||
|
|
||||||
define WEBPACK_CONFIG
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
entry: './src/main.js',
|
|
||||||
mode: 'production',
|
|
||||||
output: {
|
|
||||||
filename: '$(PACKAGE).js',
|
|
||||||
path: path.resolve(__dirname)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
endef
|
|
||||||
export WEBPACK_CONFIG
|
|
||||||
webpack.config.js:
|
|
||||||
echo "$$WEBPACK_CONFIG" >> $@
|
|
||||||
|
|
||||||
package-lock.json:
|
|
||||||
$(DOCKER_CMD) npm install webpack webpack-cli --save-dev
|
|
||||||
|
|
||||||
package.json:
|
|
||||||
$(DOCKER_CMD) /bin/bash -c "npm set init.license 'MIT' && npm set init.author.name '$(AUTHOR)' && npm init -y"
|
|
||||||
$(DOCKER_CMD) sed -E -i -e '/^ +"main"/d' -e '/^ +"scripts"/a\ "build": "webpack",' -e '/^ +"scripts"/a\ "watch": "webpack --watch --mode=development",' -e '2a\ "private": true,' $@
|
|
4018
package-lock.json
generated
Normal file
4018
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
25
package.json
Normal file
25
package.json
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"name": "slider-entity-row",
|
||||||
|
"private": true,
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "slider-entity-row =================",
|
||||||
|
"scripts": {
|
||||||
|
"build": "webpack",
|
||||||
|
"watch": "webpack --watch --mode=development",
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "github.com:thomasloven/lovelace-slider-entity-row"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "Thomas Lovén",
|
||||||
|
"license": "MIT",
|
||||||
|
"devDependencies": {
|
||||||
|
"webpack": "^4.41.2",
|
||||||
|
"webpack-cli": "^3.3.10"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"card-tools": "github:thomasloven/lovelace-card-tools"
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
import {LitElement, html, css} from "/card-tools/lit-element.js";
|
import {LitElement, html, css} from "card-tools/src/lit-element.js";
|
||||||
|
|
||||||
import { Controller } from "./controller.js";
|
import { Controller } from "./controller.js";
|
||||||
import { LightController } from "./light-controller.js";
|
import { LightController } from "./light-controller.js";
|
||||||
|
10
webpack.config.js
Normal file
10
webpack.config.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: './src/main.js',
|
||||||
|
mode: 'production',
|
||||||
|
output: {
|
||||||
|
filename: 'slider-entity-row.js',
|
||||||
|
path: path.resolve(__dirname)
|
||||||
|
}
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user