How to use the webpack-atoms.loaders.imports function in webpack-atoms

To help you get started, we’ve selected a few webpack-atoms 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 jquense / react-widgets / tools / build-localizer.js View on Github external
const path = require('path')
const webpack = require('webpack')
const { plugins, rules, loaders } = require('webpack-atoms')

let [externals] = process.argv.slice(2)
const dirname = process.cwd()

let { name } = require(`${dirname}/package.json`)

const compiler = webpack({
  // mode: 'production',
  // optimization: {
  //   minimize: false,
  // },
  entry:
    `${loaders.imports().loader}?` +
    `module=${path.join(dirname, 'localizer.js')}` +
    `!${require.resolve('./shim.js')}`,

  output: {
    path: path.join(dirname, './dist'),
    filename: name + '.js',
    libraryTarget: 'var',
  },
  module: {
    rules: [rules.js({ envName: 'esm' })],
  },
  plugins: [
    plugins.define(),
    plugins.banner({
      banner:
        '(c) 2014 - present: Jason Quense | https://github.com/jquense/react-widgets/blob/master/LICENSE.md',
github jquense / react-widgets / tools / localizer-config.js View on Github external
module.exports = function (config) {
  return merge({}, config, {
    devtool: 'source-map',
    entry: `${loaders.imports().loader}?` +
      `module=${path.resolve(process.cwd(), config.entry)}` +
      `!${require.resolve('./shim.js')}`,
    output: {
      libraryTarget: 'var'
    },
    module: {
      rules: [
        rules.js()
      ]
    },
    plugins: [
      plugins.define(),
      plugins.banner({
        banner:'(c) 2014 - present: Jason Quense | https://github.com/jquense/react-widgets/blob/master/LICENSE.md',
        entryOnly : true,
      }),