BROKEN: Sam's attempt at getting component css into the website

This commit is contained in:
Sam Nolan 2022-06-05 06:48:31 +00:00
parent 9b0def16ef
commit 906534615a
7 changed files with 20 additions and 30 deletions

View File

@ -42,6 +42,8 @@
"@types/styled-components": "^5.1.24",
"@types/webpack": "^5.28.0",
"cross-env": "^7.0.3",
"mini-css-extract-plugin": "^2.6.0",
"postcss-loader": "^7.0.0",
"react-scripts": "^5.0.1",
"style-loader": "^3.3.1",
"tailwindcss": "^3.0.24",
@ -94,6 +96,6 @@
"@types/react": "17.0.43"
},
"source": "./src/index.ts",
"main": "./dist/src/index.js",
"main": "./dist/bundle.js",
"types": "./dist/src/index.d.ts"
}

View File

@ -0,0 +1,7 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
cssnano: {},
}
}

View File

@ -1,24 +1,26 @@
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
mode: "production",
devtool: "source-map",
profile: true,
entry: "./src/index.ts",
entry: ["./src/index.ts", "./src/tailwind.css"],
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
options: { projectReferences: true, transpileOnly: true },
options: { projectReferences: true },
exclude: /node_modules/,
},
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
use: [MiniCssExtractPlugin.loader, "css-loader", "postcss-loader"],
},
],
},
plugins: [new MiniCssExtractPlugin()],
resolve: {
extensions: [".js", ".tsx", ".ts"],
alias: {

View File

@ -20,25 +20,6 @@ const config = {
projectName: "squiggle", // Usually your repo name.
plugins: [
"docusaurus-tailwindcss",
() => ({
configureWebpack(config, isServer, utils, content) {
return {
resolve: {
alias: {
"@quri/squiggle-components": path.resolve(
__dirname,
"../components/src"
),
"@quri/squiggle-lang": path.resolve(
__dirname,
"../squiggle-lang/src/js"
),
},
},
};
},
}),
],
presets: [

View File

@ -1,13 +1,10 @@
@import("@quri/squiggle-components/dist/main.css")
/**
* Any CSS included here will be global. The classic template
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/
@tailwind base;
@tailwind components;
@tailwind utilities;
/* You can override the default Infima variables here. */
:root {
--ifm-color-primary: #2488df;

View File

@ -0,0 +1 @@
module .exports = {}

View File

@ -4341,9 +4341,9 @@
"@types/react" "*"
"@types/react@*", "@types/react@^18.0.1", "@types/react@^18.0.9":
version "18.0.10"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.10.tgz#5692944d4a45e204fb7a981eb1388afe919cf4d0"
integrity sha512-dIugadZuIPrRzvIEevIu7A1smqOAjkSMv8qOfwPt9Ve6i6JT/FQcCHyk2qIAxwsQNKZt5/oGR0T4z9h2dXRAkg==
version "18.0.11"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.11.tgz#94c9b62020caff17d117374d724de853ec711d21"
integrity sha512-JxSwm54IgMW4XTR+zFF5QpNx4JITmFbB4WHR2J0vg9RpjNeyqEMlODXsD2e64br6GX70TL0UYjZJETpyyC1WdA==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"