Simplify asset building (#3459)
* Add tailwind and esbuild
* Remove unused images
* Move unprocessed assets to priv directory
* Fix applyTheme script
* Remove autoprefixer
* Update bundlemon
* Remove babel config
* Revert "Remove autoprefixer"
This reverts commit fc60c31c73.
* Make dashboard react file work
* Fix app.css imports
* Remove autoprefixer
* Add back in robots.txt
* Go back to css/ and js/ folders as opposed to assets/
* Bundle embed.host.js and embed.content.js
* Add components folder to live reload paths
* Remove bundlemon
* Use mix assets task in Dockerfil
* Add assets setup to CONTRIBUTING.md
pull/3472/head
@ -1,6 +0,0 @@
|
||||
{
|
||||
"presets": [
|
||||
"@babel/preset-env",
|
||||
"@babel/preset-react"
|
||||
]
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
{
|
||||
"baseDir": "../priv/",
|
||||
"reportOutput": ["github"],
|
||||
"files": [
|
||||
{
|
||||
"path": "static/js/*.js"
|
||||
},
|
||||
{
|
||||
"path": "static/css/app.css"
|
||||
},
|
||||
{
|
||||
"path": "tracker/js/plausible.js"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
@ -1,48 +0,0 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
const CssMinimizerWebpackPlugin = require('css-minimizer-webpack-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
|
||||
module.exports = (env, options) => ({
|
||||
optimization: {
|
||||
minimizer: [
|
||||
new TerserPlugin(),
|
||||
new CssMinimizerWebpackPlugin()
|
||||
]
|
||||
},
|
||||
entry: {
|
||||
'app': ['./js/app.js'],
|
||||
'dashboard': ['./js/dashboard/mount.js'],
|
||||
'embed.host': ['./js/embed.host.js'],
|
||||
'embed.content': ['./js/embed.content.js']
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname, '../priv/static/js')
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(js|jsx)$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader'
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [MiniCssExtractPlugin.loader, 'css-loader', 'postcss-loader']
|
||||
}
|
||||
]
|
||||
},
|
||||
externals: { moment: 'moment' },
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin({filename: '../css/[name].css'}),
|
||||
new CopyWebpackPlugin({patterns: [{from: 'static/', to: '../' }]}),
|
||||
new webpack.ProvidePlugin({
|
||||
ResizeObserver: ['@juggle/resize-observer', 'ResizeObserver'] // https://caniuse.com/?search=ResizeObserver
|
||||
})
|
||||
]
|
||||
});
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |