%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/ns.eco-n-tech.co.uk/html/
Upload File :
Create Path :
Current File : /var/www/ns.eco-n-tech.co.uk/html/__!__webpack.config.js

// const localDomain = 'http://next.com/';
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: {
        main: './src/js/app.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: 'sass-sourcemap-loader',
					},
					{
						loader: "postcss-loader",
						options: {
							sourceMap: true,
						  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', '**/*.html', 'dist/*.*'],
	  		proxy: 'http://localhost/next-solution/',
			injectCss: false,
			//host: 'localhost',
      		//port: 3100,
			//server: { baseDir: './' }
		}, { reload: false, }),
	]
};

Zerion Mini Shell 1.0