diff --git a/assets/js/lib/test-utils/ui/index.jsx b/assets/js/lib/test-utils/ui/index.jsx index 34cde512af..998816f7ac 100644 --- a/assets/js/lib/test-utils/ui/index.jsx +++ b/assets/js/lib/test-utils/ui/index.jsx @@ -1,7 +1,11 @@ import React from 'react'; +// eslint-disable-next-line import/no-dynamic-require +const pkg = require(`${process.cwd()}/package.json`); + +// Application global css const css = require('fs').readFileSync( - `${__dirname}/../../../../../priv/static/assets/app.css`, + `${process.cwd()}/${pkg.variables.css}`, 'utf8' ); diff --git a/assets/package.json b/assets/package.json index b044d0d831..060bfe0316 100644 --- a/assets/package.json +++ b/assets/package.json @@ -78,16 +78,19 @@ "overrides": { "@testing-library/dom": "^9.0.1" }, + "variables": { + "css": "../priv/static/assets/app.css" + }, "scripts": { - "tailwind:build": "tailwindcss --postcss --minify --input=css/app.css --output=../priv/static/assets/app.css", + "tailwind:build": "tailwindcss --postcss --minify --input=css/app.css --output=$npm_package_variables_css", "build": "node build.js", - "deploy": "tailwindcss --postcss --minify --input=css/app.css --output=../priv/static/assets/app.css && node build.js", + "deploy": "tailwind:build && npm run build", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build", "lint": "eslint . --ext js,jsx", "format:check": "prettier -c .", "format": "prettier --write .", - "pretest": "ls ../priv/static/assets/app.css || npm run tailwind:build", + "pretest": "ls $npm_package_variables_css || npm run tailwind:build", "test": "jest", "chromatic": "npx chromatic --exit-zero-on-changes" }