LoginSignup
1
0

More than 5 years have passed since last update.

WebPackでモバイルとデスクトップの切り分けをする

Last updated at Posted at 2018-12-30

JavaScriptファイルを分ける場合のwebpack.config.jsの設定

entryとoutputを設定してあげるとそれぞれのディレクトリができる

webpack.config.js
const path = require('path');
...
   entry:{
      desktop: src/js/desktop.js,
      mobile: src/js/mobile.js
    }
   output:{
      path: path.resolve(__dirname, 'dist'),
      filename: '[name]/bundle.js'
    }
...

Entry Points
https://webpack.js.org/concepts/entry-points/

Output
https://webpack.js.org/concepts/output/

1
0
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
1
0