How to use webpack-nano - 4 common examples

To help you get started, weā€™ve selected a few webpack-nano examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github arso-project / sonar / sonar-ui / webpack.config.js View on Github external
const { WebpackPluginServe } = require('webpack-plugin-serve')

const isDev = argv.watch || argv.serve || process.env.NODE_ENV === 'development'
let output = 'dist'
let ramdisk = false
if (isDev) {
  // Optional ramdisk arg to build in a ramdisk (faster!)
  ramdisk = !!argv.ramdisk || !!process.env.WP_RAM
  output = ramdisk ? 'build-ramdisk' : 'build'
}
output = p.join(__dirname, output)

const config = {
  entry: ['./src/index.js'],
  mode: isDev ? 'development' : 'production',
  watch: argv.watch || argv.serve,
  devtool: isDev ? 'eval-source-map' : 'none',
  // stats: 'minimal',
  stats: 'minimal',
  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        use: [
          'babel-loader'
        ]
      },
      {
        test: /\.(css|pcss)$/,
        use: [
          'style-loader',
github arso-project / sonar / sonar-ui / webpack.config.js View on Github external
const argv = require('webpack-nano/argv')
const p = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { WebpackPluginServe } = require('webpack-plugin-serve')

const isDev = argv.watch || argv.serve || process.env.NODE_ENV === 'development'
let output = 'dist'
let ramdisk = false
if (isDev) {
  // Optional ramdisk arg to build in a ramdisk (faster!)
  ramdisk = !!argv.ramdisk || !!process.env.WP_RAM
  output = ramdisk ? 'build-ramdisk' : 'build'
}
output = p.join(__dirname, output)

const config = {
  entry: ['./src/index.js'],
  mode: isDev ? 'development' : 'production',
  watch: argv.watch || argv.serve,
  devtool: isDev ? 'eval-source-map' : 'none',
  // stats: 'minimal',
  stats: 'minimal',
github arso-project / sonar / sonar-ui / webpack.config.js View on Github external
]
  },
  output: {
    path: output,
    publicPath: '/',
    filename: 'bundle.js'
  },
  plugins: [
    new HtmlWebpackPlugin({
      title: 'Sonar'
      // template: './index.html'
    })
  ]
}

if (argv.serve) {
  config.plugins.push(
    new WebpackPluginServe({
      host: 'localhost',
      static: output,
      open: false,
      liveReload: true,
      historyFallback: true,
      // progress: 'minimal',
      progress: false,
      ramdisk: ramdisk
    })
  )
  config.entry.push(
    'webpack-plugin-serve/client'
  )
}
github arso-project / sonar / sonar-ui / webpack.config.js View on Github external
const argv = require('webpack-nano/argv')
const p = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { WebpackPluginServe } = require('webpack-plugin-serve')

const isDev = argv.watch || argv.serve || process.env.NODE_ENV === 'development'
let output = 'dist'
let ramdisk = false
if (isDev) {
  // Optional ramdisk arg to build in a ramdisk (faster!)
  ramdisk = !!argv.ramdisk || !!process.env.WP_RAM
  output = ramdisk ? 'build-ramdisk' : 'build'
}
output = p.join(__dirname, output)

const config = {
  entry: ['./src/index.js'],
  mode: isDev ? 'development' : 'production',
  watch: argv.watch || argv.serve,
  devtool: isDev ? 'eval-source-map' : 'none',
  // stats: 'minimal',
  stats: 'minimal',
  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,

webpack-nano

A teensy, squeaky šŸ¤ clean Webpack CLI

MPL-2.0
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis