%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/businessmultisite/wp-content/themes/stripes_weekly/
Upload File :
Create Path :
Current File : //var/www/businessmultisite/wp-content/themes/stripes_weekly/webpack.config.js

const localDomain = 'http://stripes.local/';
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
 
module.exports = {
	// entry: './src/js/app.js',
	entry: {
		app: './src/js/app.js',
		admin: './src/js/admin.js',
	},
	output: {
		path: path.resolve(__dirname, 'dist'),
		// filename: 'app.js',
		filename: '[name].js',
		environment: {
			arrowFunction: false,
			bigIntLiteral: false,
			const: false,
			destructuring: false,
			dynamicImport: false,
			forOf: false,
			module: false,
		},
	},
	module: {
		rules: [
			{
				test: /\.(scss|css)$/,
				use: [
				process.env.NODE_ENV !== 'production'
				? 'style-loader'
				: MiniCssExtractPlugin.loader,
				'css-loader',
				{
					loader: "postcss-loader",
					options: {
					  postcssOptions: {
						plugins: [
						  [
							"autoprefixer",
							{
							  // Options
							},
						  ],
						],
					  },
					},
				},
				{
					loader: 'sass-loader',
					options: {
						sourceMap: true
					}
				}
				
				]
			},

			{
				test: /\.m?js$/,
				exclude: /(node_modules|bower_components)/,
				use: {
					loader: 'babel-loader',
					options: {
					presets: ['@babel/preset-env'],
					plugins: ['@babel/plugin-transform-arrow-functions']
					}
				}
			}
		  
		]
	},
	plugins: [
		new CleanWebpackPlugin(),
		new MiniCssExtractPlugin({
			filename: '[name].css',
		}),
		new CopyPlugin({
			patterns: [{ from: 'src/img', to: 'img' }]
		}),
		new BrowserSyncPlugin({
			files: ['**/*.twig', '**/*.php', 'dist/*.*'],
	  		proxy: localDomain, 
			injectCss: true
		}, { reload: false, }),
	]
};

// const localDomain = 'http://stripes.local/';
// const path = require('path');
// const MiniCssExtractPlugin = require('mini-css-extract-plugin');
// const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
// const { CleanWebpackPlugin } = require('clean-webpack-plugin');
// const CopyPlugin = require('copy-webpack-plugin');
 
// module.exports = {
// 	// entry: './src/js/app.js',
// 	entry: {
//         main: './src/js/app.js',
//         admin: './src/js/admin.js',
//     },
// 	output: {
// 		path: path.resolve(__dirname, 'dist'),
// 		filename: '[name].js',
// 		environment: {
// 			arrowFunction: false,
// 			bigIntLiteral: false,
// 			const: false,
// 			destructuring: false,
// 			dynamicImport: false,
// 			forOf: false,
// 			module: false,
// 		},
// 	},
// 	module: {
// 		rules: [
// 			{
// 				test: /\.(scss|css)$/,
// 				use: [
// 				process.env.NODE_ENV !== 'production'
// 				? 'style-loader'
// 				: MiniCssExtractPlugin.loader,
// 				'css-loader',
// 				{
// 					loader: "postcss-loader",
// 					options: {
// 					  postcssOptions: {
// 						plugins: [
// 						  [
// 							"autoprefixer",
// 							{
// 							  // Options
// 							},
// 						  ],
// 						],
// 					  },
// 					},
// 				},
// 				{
// 					loader: 'sass-loader',
// 					options: {
// 						sourceMap: true
// 					}
// 				}
				
// 				]
// 			},
// 			{
// 				test: /\.jpg/,
// 				type: 'asset/resource'
// 			},
// 			{
// 				test: /\.m?js$/,
// 				exclude: /(node_modules|bower_components)/,
// 				use: {
// 					loader: 'babel-loader',
// 					options: {
// 					presets: ['@babel/preset-env'],
// 					plugins: ['@babel/plugin-transform-arrow-functions']
// 					}
// 				}
// 			}
		  
// 		]
// 	},
// 	plugins: [
// 		new CleanWebpackPlugin(),
// 		new MiniCssExtractPlugin({
// 			filename: '[name].css',
// 		}),
// 		new CopyPlugin({
// 			patterns: [{ from: 'src/img', to: 'img' }]
// 		}),
// 		new BrowserSyncPlugin({
// 			files: ['**/*.php', '**/*.twig', 'dist/*.*'],
// 	  		proxy: localDomain, 
// 			injectCss: true
// 		}, { reload: false, }),
// 	]
// };

Zerion Mini Shell 1.0