How to use the @webpack-blocks/webpack.createConfig function in @webpack-blocks/webpack

To help you get started, we’ve selected a few @webpack-blocks/webpack 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 cyclejs-community / one-fits-all / configs / webpack.config.js View on Github external
uglifyOptions: {
                    compress: {
                        warnings: false
                    }
                }
            }),
            addPlugins([
                new CleanWebpackPlugin([appPath('build')], {
                    root: process.cwd()
                }),
                new CopyWebpackPlugin([{ from: 'public', to: '' }])
            ])
        ])
    ]),
    userConfig,
    createConfig([
        env('test', [
            customConfig({
                target: 'node',
                externals: [nodeExternals()],
                output: {
                    // use absolute paths in sourcemaps (important for debugging via IDE)
                    devtoolModuleFilenameTemplate: '[absolute-resource-path]',
                    devtoolFallbackModuleFilenameTemplate:
                        '[absolute-resource-path]?[hash]'
                },
                module: {
                    rules: [
                        {
                            test: /\.(jsx?|tsx?)/,
                            include: packageJson.nyc.include.map(p =>
                                path.resolve(appPath(p))
github hydux / hydux-pixi / examples / compare / webpack.config.dll.js View on Github external
const webpack = require('webpack')
const { uglify } = require('webpack-blocks')
const {
  createConfig, defineConstants, env, addPlugins,
  entryPoint, setOutput, sourceMaps,
  customConfig,
} = require('@webpack-blocks/webpack')
const path = require('path')
const devServer = require('@webpack-blocks/dev-server')
// const cssModules = require('./tools/webpack-blocks/css-loader')

const DIST = `${__dirname}/static/dist`

module.exports = createConfig([
  entryPoint({
    vendor: ['./src/vendor.ts'],
  }),
  setOutput({
    filename: '[name].dll.js',
    path: DIST,
    publicPath: '/static/dist',
    library: '[name]', // needed for dll plugin
  }),
  // cssModules(),
  defineConstants({
    'process.env.NODE_ENV': process.env.NODE_ENV,
  }),
  customConfig({
    resolve: {
      extensions: ['.ts', '.tsx', '.js'],
github cyclejs-community / one-fits-all / configs / webpack.config.js View on Github external
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const nodeExternals = require('webpack-node-externals');

const path = require('path');

const appPath = (...names) => path.join(process.cwd(), ...names);
const userConfig = require(appPath('webpack.config.js'));
const packageJson = require(appPath('package.json'));

const PORT = process.env.PORT || 8080;

module.exports = webpackMerge(
    createConfig([
        setMode(
            process.env.NODE_ENV === 'production' ? 'production' : 'development'
        ),
        typescript({
            useCache: true,
            cacheDirectory: 'node_modules/.cache/at-loader'
        }),
        tslint(),
        resolve({ extensions: ['.js', '.jsx'] }),
        match(
            ['*.scss', '*.sass'],
            [
                css(),
                sass({
                    includePaths: [appPath('node_modules')],
                    sourceMap: true