Skip to content

Commit

Permalink
Lint, gitlab-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
vietredweb committed Nov 4, 2022
1 parent ed7a368 commit 6b44b3d
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
27 changes: 27 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
image: node:14-alpine

stages:
- lint
- build


lint:
stage: lint
environment:
name: production
script:
- npm install
- npm run lint

build:
stage: build
environment:
name: production
only:
- master
script:
- npm install
- npm run build



2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

To build the tracker file:

`npm run build-tracker`
`npm run build`
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
"rollup-plugin-uglify": "^6.0.4"
},
"scripts": {
"start": "npm run build && serve -s build",
"build": "npm run build-tracker && react-scripts build",
"test": "react-scripts test",
"dev": "npm run build-tracker && react-scripts start",
"build-tracker": "rollup -c \"rollup.tracker.config.js\""
"build": "rollup -c \"rollup.tracker.config.js\"",
"lint": "eslint --fix \"src/**/\"",
"lint:check": "eslint \"src/**/\"",
"lint:nowarns": "eslint --quiet \"src/**/\""
},
"eslintConfig": {
"extends": [
Expand Down
1 change: 0 additions & 1 deletion public/analytics.js

This file was deleted.

2 changes: 1 addition & 1 deletion rollup.tracker.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { uglify } from 'rollup-plugin-uglify';
export default {
input: 'src/index.js',
output: {
file: 'public/analytics.js',
file: 'build/analytics.js',
format: 'iife',
name: 'analytics',
},
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const { default: axios } = require('axios');
const attr = currentScript.getAttribute.bind(currentScript);
const website = attr(_data + 'website-id');

// eslint-disable-next-line no-undef
const hostUrl = envEndpoint;
const autoTrack = attr(_data + 'auto-track') !== _false;
const root = hostUrl
Expand Down

0 comments on commit 6b44b3d

Please sign in to comment.