{"size": 2411, "ext": "js", "max_stars_repo_path": "webpack.config.js", "max_stars_repo_name": "HBDunn/rnstruct", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "webpack.config.js", "max_issues_repo_name": "HBDunn/rnstruct", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "webpack.config.js", "max_forks_repo_name": "HBDunn/rnstruct", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.9247311828, "max_line_length": 128, "alphanum_fraction": 0.5640812941}
const webpack = require('webpack');
const path = require('path');
const devMode = process.env.NODE_ENV !== 'production'

const TSLintPlugin = require('tslint-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

//const ExtractCssChunks = require("extract-css-chunks-webpack-plugin")

module.exports = {
 entry: {
   main: './index.js'
 },
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname,'dist')
  },
	target:'web',
  devtool: 'source-map',
	devServer: {
    contentBase: '/'
  },
  module: {
    rules: [
      {
        test: /\.tsx?$/,
        include: path.resolve(__dirname, 'src'),
        use: [
          'babel-loader',
          'ts-loader'
        ]
      },
      {
        test: /\.jsx?$/,
        exclude: /node_modules/,
        use: [
          'babel-loader'
        ]
      },
			{
				// Preprocess our own .css files
        test: /\.(sa|sc|c)ss$/,
        use: [
          devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
          'css-loader'
          //'postcss-loader',
          //'sass-loader',
        ]
			},
			{
				test: /\.(jpg|png|svg|ico|icns)$/,
				use:[
					{loader: 'file-loader',
						options: {
						name: './[name].[ext]'
						}
					}
				]
			}
    ]
  },
  resolve: {
		modules:["node_modules"],
    extensions: [".tsx", ".ts", ".js", ".json"]
  },
  plugins: [
    new TSLintPlugin({
      files: ['src/**/*.ts']
    }),
    new CleanWebpackPlugin(['dist']),
    new MiniCssExtractPlugin({
      filename: devMode ? '[name].css' : '[name].[hash].css',
      chunkFilename: devMode ? '[id].css' : '[id].[hash].css',
    }),
    new HtmlWebpackPlugin({
      inject: false,
      template: path.resolve('index.html')
    })//inject bug fix double init on start
    /*new ExtractCssChunks(
    {
      // both options are optional
      filename: "[name].css",
      chunkFilename: "[id].css",
      hot: true, // if you want HMR - we try to automatically inject hot reloading but if it's not working, add it to the config
      orderWarning: true, // Disable to remove warnings about conflicting order between imports
      reloadAll: true, // when desperation kicks in - this is a brute force HMR flag
      cssModules: true // if you use cssModules, this can help.
    })*/
  ],
}
