How to use @instructure/ui-webpack-config - 5 common examples

To help you get started, we’ve selected a few @instructure/ui-webpack-config 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 instructure / instructure-ui / packages / __examples__ / .storybook / webpack.config.js View on Github external
module.exports = ({ config, mode }) => {
  const baseConfig = require('@instructure/ui-webpack-config')
  config = merge(config, baseConfig)

  // need to override this instead of merge for these...
  config.module.rules = baseConfig.module.rules
  config.optimization = require('@instructure/ui-webpack-config/config/optimization')
  if (process.env.NODE_ENV === 'production') {
    config.devtool = 'none'
  }

  console.log(`Building Storybook with React version ${React.version}...`)

  if (parseFloat(React.version) < 16) {
    console.error('Storybook requires React > 16. Run `yarn install:react:16` before running `yarn start:examples`.')
  }

  return config
}
github instructure / instructure-ui / packages / ui-karma-config / lib / index.js View on Github external
cache: !DEBUG,
        mode: 'development',
        devtool: DEBUG ? 'cheap-module-source-map': 'none',
        externals: {
          'react/lib/ExecutionEnvironment': true,
          'react/lib/ReactContext': true,
          'react/addons': true,
          // The karma mocha plugin exposes a mocha instance as `window.mocha`,
          // but the mocha npm package exports the mocha contructor function.
          // The choma script needs access to the mocha constructor so it can
          // monkey-patch it for random test ordering.
          'mocha': 'mocha.constructor'
        },
        resolveLoader: {
          alias: {
            ...baseWebpackConfig.resolveLoader.alias,
            'ui-tests-loader': path.join(__dirname, './loaders/ui-tests-loader')
          }
        }
      },

      webpackMiddleware: { stats: 'errors-only' },

      // TODO: pull breakpoints from theme
      viewport: {
        breakpoints: [
          {
            name: 'small',
            size: {
              width: 320,
              height: 480
            }
github instructure / instructure-ui / packages / ui-presets / webpack / module / rules.js View on Github external
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
module.exports = require('@instructure/ui-webpack-config').module.rules
github instructure / instructure-ui / packages / __docs__ / webpack.config.js View on Github external
'react',
      'react-dom'
    ],
    globals: './globals.js'
  },
  output: {
    path: outputPath,
    filename: '[name].js'
  },
  devServer: {
    disableHostCheck: true,
    contentBase: outputPath,
    host: '0.0.0.0'
  },
  plugins: [
    ...baseConfig.plugins,
    ...require('./plugins')
  ],
  resolve: DEBUG ? require('./resolve') : { mainFields: ['main'] }
}
github instructure / instructure-ui / packages / ui-presets / webpack / plugins.js View on Github external
module.exports = function plugins () {
  return require('@instructure/ui-webpack-config').plugins
}

@instructure/ui-webpack-config

A shared webpack config made by Instructure Inc.

MIT
Latest version published 1 month ago

Package Health Score

76 / 100
Full package analysis

Similar packages