Questions around setting up typescript, purgecss and importing CSS files #80
-
Hi there, I've been using theme-lab for a while now and it's amazing. I just have a couple of issues I hoped someone could help me with.
|
Beta Was this translation helpful? Give feedback.
Answered by
sergejcodes
May 23, 2021
Replies: 1 comment
-
Hi 👋,
$ npm i -D typescript ts-loader
{
"compilerOptions": {
"target": "es5",
"moduleResolution": "node"
}
}
...
resolve: {
extensions: [..., '.tsx', '.ts'],
}
...
...
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
}
]
...
$ npm i -D @fullhuman/postcss-purgecss
const path = require('path')
...
plugins: [
...
require('@fullhuman/postcss-purgecss')({
content: [
path.resolve(__dirname, '../shopify/**/*.liquid'),
path.resolve(__dirname, '../src/**/*.{js|vue}')
]
}),
...
]
import 'semantic-ui-css/semantic.css'
import 'bootstrap-icons/font/bootstrap-icons.css'
$ npm i -D file-loder
...
rules: [
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: {
loader: 'url-loader',
options: {
limit: 99999999
}
}
}
]
...
...
rules: [
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: {
loader: 'file-loader',
options: {
name: '[name].[ext]',
publicPath: './',
outputPath: './'
}
}
}
]
... |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
arash-038
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi 👋,
this should help:
tsconfig.json
in the root directory with the following content:.config/webpack/webpack.common.js
:.config/webpack/webpack.common.js
:@fullhuman/postcss-purgecss
:.config/postcss.c…