12
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

yarn buildはnpm run buildと同じ

Posted at

0. yarnを使う

npmの代わりにyarnでwebpackプロジェクトをbuildしてみた。

1. webpack.config

const path = require('path');

const config = {
  entry: './src/index.js',
  output: {
    path: path.resolve(__dirname, 'build'),
    filename: 'bundle.js'
  },
  module: {
    rules: [
      {
        use: 'babel-loader',
        test: /\.js$/,
      }
    ]
  }
};

module.exports = config;

2. .babelrc

{
  "presets": ["babel-preset-env"]
}

3. build

npm run buildのかわりにyarn run buildもしくはyarn buildでbuildができた。

12
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?