UNPKG

react-magnify

Version:

Magnifying glass for image zoom using ReactJS

78 lines (73 loc) 1.56 kB
"use strict"; var webpack = require('webpack'); var path = require('path'); var loaders = require('./webpack.loaders'); var HtmlWebpackPlugin = require('html-webpack-plugin'); const HOST = process.env.HOST || "127.0.0.1"; const PORT = process.env.PORT || "9000"; // global css loaders.push({ test: /\.css$/, exclude: /[\/\\]src[\/\\]/, loaders: [ 'style?sourceMap', 'css' ] }); // local scss modules loaders.push({ test: /\.scss$/, exclude: /[\/\\](node_modules|bower_components|public)[\/\\]/, loaders: [ 'style?sourceMap', 'css', 'postcss', 'sass' ] }); // local css modules loaders.push({ test: /\.css$/, exclude: /[\/\\](node_modules|bower_components|public)[\/\\]/, loaders: [ 'style?sourceMap', 'css' ] }); module.exports = { entry: [ 'react-hot-loader/patch', './src/index.js' // your app's entry point ], devtool: process.env.WEBPACK_DEVTOOL || 'cheap-module-source-map', output: { path: path.join(__dirname, 'public1'), filename: 'bundle.js' }, resolve: { extensions: ['', '.js', '.jsx'] }, module: { loaders }, devServer: { contentBase: "./public1", // do not print bundle build stats noInfo: true, // enable HMR hot: true, // embed the webpack-dev-server runtime into the bundle inline: true, // serve index.html in place of 404 responses to allow HTML5 history historyApiFallback: true, port: PORT, host: HOST }, plugins: [ new webpack.NoErrorsPlugin(), new webpack.HotModuleReplacementPlugin(), new HtmlWebpackPlugin({ template: './src/template.html' }), ] };