How to use strip-loader - 10 common examples

To help you get started, we’ve selected a few strip-loader 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 JRF-tw / protest.jrf.org.tw / webpack / prod.config.js View on Github external
module.exports = {
  devtool: 'source-map',
  context: path.resolve(__dirname, '..'),
  entry: {
    'main': './src/client.js'
  },
  output: {
    path: assetsPath,
    filename: '[name]-[chunkhash].js',
    chunkFilename: '[name]-[chunkhash].js',
    publicPath: '/dist/'
  },
  module: {
    loaders: [
      { test: /\.jsx?$/, exclude: /node_modules/, loaders: [strip.loader('debug'), 'babel?stage=0&optional=runtime&plugins=typecheck']},
      { test: /\.json$/, loader: 'json-loader' },
      // { test: /\.scss$/, loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=2&sourceMap!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded&sourceMap=true&sourceMapContents=true') },
      // { test: /\.css$/, loader: 'style!css' },
      // use this if you want to build css seperated
      { test: /\.css$/, loader: ExtractTextPlugin.extract('style', 'css') },
      { test: webpackIsomorphicToolsPlugin.regular_expression('images'), loader: 'url-loader?limit=10240' }
    ]
  },
  progress: true,
  resolve: {
    modulesDirectories: [
      'src',
      'node_modules'
    ],
    extensions: ['', '.json', '.js', '.jsx']
  },
github voletiswaroop / react-material-ui-form / webpack.config.js View on Github external
// development
if (!args.p) {
  plugins.push(
    new HtmlWebPackPlugin({
      template: './examples/index.html',
      filename: './index.html',
    })
  )
// production
} else {
  devtool = 'source-map'
  externals.push('react', 'react-dom', 'material-ui')
  rules.push({
    test: /\.js$/,
    exclude: path.resolve(__dirname, 'node_modules'),
    loader: WebpackStripLoader.loader('console.log'),
  })
  plugins.push(
    new webpack.DefinePlugin({
      'process.env.NODE_ENV': JSON.stringify('production'),
    })
  )
}

module.exports = {
  devtool,
  devServer: {
    historyApiFallback: true,
  },
  externals,
  output: {
    filename: 'react-material-ui-form.min.js',
github wilzbach / msa / webpack.config.js View on Github external
};
var w = module.exports;

// only executed with -p
if(prod) {
    w.plugins.push(
        new webpack.optimize.UglifyJsPlugin({
            compress: {
                collapse_vars: true
            },
        sourceMap: true
    }));
    var WebpackStrip = require('strip-loader');
    w.module.loaders.push(
        {   test: path.join(__dirname, 'src'),
         loader: WebpackStrip.loader('console.log') }
    );
}
github DailyCheckup / DailyCheckup / webpack.config.js View on Github external
path: __dirname + '/build/',
    filename: 'build.js',
  },
  // entry:'./src/main.jsx',
  // output: {
  //   path: './client',
  //   filename: 'bundle.js'
  // },
  resolve: {
    extensions: ['', '.js', '.jsx'],
  },
  module: {
    loaders: [{
      test: /\.jsx?$/,
      loaders: ['babel-loader?presets[]=react,presets[]=es2015',
      WebpackStrip.loader('console.log')],
      exclude: /node_modules/,
    },
    {
      test: /\.scss$/,
      loader: ExtractTextPlugin.extract('css!sass'),
    }],
  },
  plugins: [
    new ExtractTextPlugin('build.css', { allChunks: true }),
    new webpack.optimize.UglifyJsPlugin({
      compress: { warnings: false },
    }),
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify('production'),
      },
github Dindaleon / hapi-react-starter-kit / webpack / prod.config.js View on Github external
modules: false
    }),
    new webpack.DefinePlugin({
      'process.env.NODE_ENV': JSON.stringify('production'),
      '__SERVER__': false,
      '__CLIENT__': true
    }),
    new webpack.ProvidePlugin({
      'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
    })
  ],
  module: {
    preLoaders: [{
      test: /\.js?$/,
      exclude: /node_modules/,
      loader: WebpackStrip.loader('debug', 'console.log')
    }],
    loaders: [{
      test: /\.js?$/,
      exclude: /node_modules/,
      loader: 'babel',
      /* query: {
        cacheDirectory: true,
        presets: [ 'es2015', 'react', 'stage-0' ],
        plugins: [ 'transform-decorators-legacy', 'transform-runtime' ]
      } */
    }, {
      test: /\.json?$/,
      loader: 'json'
    }]
  }
};
github functional-promises / functional-promises / webpack.config.js View on Github external
// const rollupCommonjsPlugin = require('rollup-plugin-commonjs')

const config = module.exports = {
  devtool: dev ? 'cheap-inline-source-map' : undefined,
  entry: './src/index.js',
  output: {
    pathinfo: true,
    // filename: path.join(__dirname, 'build', 'index.js'),
    path: path.resolve(__dirname, './dist'),
    filename: `./functional-promise${dev ? '' : '.min'}.js`,
  },
  module: {
    loaders: [
      {
        test: /\.js$/,
        loader: webpackStripLoader
          .loader('debug', 'console.log', 'console.warn', 'console.error')
      }
    ],
    rules: [
      // {
      //   test: /\.js$/,
      //   loader: 'rollup-loader',
      //   // options: [/* custom rollup plugins */]
      //   // or directly pass rollup options
      //   // options: { plugins: [] }
      // },
      // {
      //   test: /src\/index.js$/,
      //   use: [{
      //     loader: 'webpack-rollup-loader',
      //     options: {
github eseom / hapi-react-fullstack-boilerplate / tools / webpack.production.js View on Github external
entry: {
    main: [
      // 'bootstrap-sass!./src/theme/bootstrap.config.prod.js',
      // 'font-awesome-webpack!./src/theme/font-awesome.config.prod.js',
      './src/client.js',
    ],
  },
  output: {
    path: assetsPath,
    filename: '[name]-[chunkhash].js',
    chunkFilename: '[name]-[chunkhash].js',
    publicPath: '/dist/',
  },
  module: {
    loaders: [
      { test: /\.jsx?$/, exclude: /node_modules/, loaders: [strip.loader('debug'), 'babel-loader'] },
      { test: /\.json$/, loader: 'json-loader' },
      {
        test: /Html.scss$/,
        use: extractText.extract([
          {
            loader: 'css-loader',
            options: {
              modules: false,
            },
          },
          {
            loader: 'sass-loader',
          },
        ]),
      },
      {
github iproduct / course-node-express-react / 14-ipt-knowledge-tester-express / webpack-prod.config.js View on Github external
var WebpackStripLoader = require('strip-loader');
var devConfig = require('./webpack.config.js');
var stripLoader = {
 test: [/\.jsx?$/],
 exclude: /node_modules/,
 loader: WebpackStripLoader.loader('console.log')
}
devConfig.module.loaders.push(stripLoader);
module.exports = devConfig;
github pantao / hapi-react-isomorphic-boilerplate / src / webpack / testing.config.js View on Github external
modules: false
    }),
    new webpack.DefinePlugin({
      'process.env.NODE_ENV': JSON.stringify('testing'),
      '__SERVER__': false,
      '__CLIENT__': true
    }),
    new webpack.ProvidePlugin({
      'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
    })
  ],
  module: {
    preLoaders: [{
      test: /(\.js[x]?|.es6)$/,
      exclude: /node_modules/,
      loader: WebpackStrip.loader('debug', 'console.log')
    }],
    loaders: [{
      test: /(\.js[x]?|.es6)$/,
      exclude: /node_modules/,
      loader: 'babel-loader'
    }, {
      test: /\.css$/,
      include: path.resolve(__dirname, 'src'),
      loader: 'style-loader!css-loader'
    }, {
      test: /\.less$/,
      include: path.resolve(__dirname, 'src'),
      loader: 'style-loader!less-loader'
    }, {
      test: /(\.png|\.jp[e]?g)$/,
      include: path.resolve(__dirname, 'src'),
github iproduct / course-node-express-react / 12-react-demo-sqlite / webpack-prod.config.js View on Github external
var WebpackStripLoader = require('strip-loader');
var devConfig = require('./webpack.config.js');
var stripLoader = {
 test: [/\.jsx?$/],
 exclude: /node_modules/,
 loader: WebpackStripLoader.loader('console.log')
}
devConfig.module.loaders.push(stripLoader);
module.exports = devConfig;

strip-loader

Webpack loader to strip arbitrary functions out of your production code.

Unrecognized
Latest version published 8 years ago

Package Health Score

44 / 100
Full package analysis

Popular strip-loader functions