You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@codecademy/webpack-config

Package Overview
Dependencies
14
Maintainers
1
Versions
804
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codecademy/webpack-config

Config files for webpack


Version published
Maintainers
1
Created

Readme

Source

webpack-config

Shared webpack configurator

Basic config

// webpack.config.js

import { createConfig } from '@codecademy/webpack-config';

module.exports = createConfig()
  .common({
    context: __dirname // required
  })
  .merge({
    entry: 'app.js' // defaults to src/main.js
    output: {
      filename: 'app.js', // defaults to main.js
      path: path.resolve(__dirname, 'public') // defaults to /dist
    }
  })
  .toConfig();

Dev server config

// webpack.config.js

import { createConfig } from '@codecademy/webpack-config';

module.exports = createConfig()
  .common({
    context: __dirname // required
  })
  .merge({
    entry: 'app.js' // defaults to main.js
    output: {
      filename: 'app.js', // defaults to main.js
      path: path.resolve(__dirname, 'public') // defaults to /dist
    }
  })
  .dev()
  .devServer({
    port: 4000, // defaults to 3808
    publicPath: `http://localhost:4000/assets/`
  })
  .toConfig();

Using Babel

By default, webpack-config doesn't set any babel options, these should be configured in your local babel.config.js file:

Example:

// babel.config.js
module.exports = {
  presets: ['codecademy'],
  plugins: ['lodash', 'react-loadable/babel'],
  ignore: ['./node_modules/@codecademy/**/node_modules'],
  only: ['./webpack', './node_modules/@codecademy'],
  env: {
    development: {
      plugins: ['react-hot-loader/babel'],
    },
  },
};

FAQs

Package last updated on 06 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc