Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //config webPack
- const path = require('path');
- const HtmlWebpackPlugin = require('html-webpack-plugin');
- const CopyWebpackPlugin = require('copy-webpack-plugin');
- module.exports = {
- entry: {
- index: './src/index.js',
- registrazione: './src/registrazione.js',
- creaSegnalazione: './src/creaSegnalazione.js'
- },
- output: {
- path: path.resolve(__dirname, 'dist'),
- filename: '[name].bundle.js',
- clean: true
- },
- module: {
- rules: [
- // ... altre regole ...
- {
- test: /\.css$/,
- use: [
- 'style-loader',
- 'css-loader',
- {
- loader: 'postcss-loader',
- options: {
- postcssOptions: {
- plugins: [
- require('tailwindcss'),
- // Altri plugin PostCSS se necessario
- ],
- minimize: true // Abilita la minificazione CSS
- }
- }
- }
- ],
- },
- ],
- },
- plugins: [
- new CopyWebpackPlugin({
- patterns: [
- { from: 'src/css', to: 'css' }, // Copia tutti i file dalla cartella "src/css" alla cartella "dist/css"
- ],
- }),
- new HtmlWebpackPlugin({
- template: './src/index.html',
- chunks: ['index'],
- filename: 'index.html'
- }),
- new HtmlWebpackPlugin({
- template: './src/registrazione.html',
- chunks: ['registrazione'],
- filename: 'registrazione.html'
- }),
- new HtmlWebpackPlugin({
- template: './src/homeSegnalatore.html',
- chunks: ['homeSegnalatore'],
- filename: 'homeSegnalatore.html'
- }),
- new HtmlWebpackPlugin({
- template: './src/creaSegnalazione.html',
- chunks: ['creaSegnalazione'],
- filename: 'creaSegnalazione.html'
- })
- ],
- devServer: {
- static: {
- directory: path.resolve(__dirname, 'dist'),
- },
- port: 3000,
- open: true,
- hot: true,
- compress: true,
- historyApiFallback: true
- },
- mode: 'development',
- devtool: 'source-map'
- };
- //config tailwind
- /** @type {import('tailwindcss').Config} */
- module.exports = {
- content: ['./dist/*.html'],
- theme: {
- extend: {},
- },
- plugins: [],
- }
- //postcss config
- const tailwindcss = require('tailwindcss');
- module.exports = {
- plugins: [
- require("tailwindcss")("./tailwind.config.js"),
- require("autoprefixer")
- ],
- };
- //packagejson
- {
- "name": "sdsapp",
- "version": "1.0.0",
- "description": "",
- "main": "index.js",
- "scripts": {
- "build": "webpack --mode production",
- "watch": "webpack --mode development --watch",
- "start": "webpack serve"
- },
- "keywords": [],
- "author": "",
- "license": "ISC",
- "devDependencies": {
- "@firebase/analytics": "^0.10.0",
- "@firebase/app": "^0.9.13",
- "autoprefixer": "^10.4.14",
- "copy-webpack-plugin": "^11.0.0",
- "css-loader": "^6.8.1",
- "html-webpack-plugin": "^5.5.3",
- "postcss": "^8.4.24",
- "postcss-loader": "^7.3.3",
- "style-loader": "^3.3.3",
- "tailwindcss": "^3.3.2",
- "webpack": "^5.88.0",
- "webpack-cli": "^5.1.4",
- "webpack-dev-server": "^4.15.1"
- },
- "dependencies": {
- "body-parser": "^1.20.2",
- "express": "^4.18.2",
- "firebase": "^9.23.0",
- "mysql": "^2.18.1"
- }
- }
- // boil
- ---dist
- ---node_modules
- ---src
- ---backend
- ---css
- ---style.css
- ---(...file js e html vari)
- ---input.css
- ---gitignore
- ---package-lock.json
- ---package.json
- ---postcss.config.js
- ---tailwind.js
- ---webpack.config.js
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement