LoginSignup
1
0

More than 3 years have passed since last update.

webpack.mix.jsのmix.jsで親ディレクトリ(parent)にjsファイルを出力する方法

Posted at

webpack.mix.jsで下記のディレクトリ配置にしてnpm dev buildしてみる

ソース
/www/src/app.js
出力
/www/public/js/app.js

mix.setPublicPath.js('app.js', '../public/js')
✔ Compiled Successfully in 17215ms
/public/js/app.js

と表示されるも/www/public/js/はからっぽ...

検索していると下記のgithub issueを発見

Unable to mix output .js file to the parent directory
https://github.com/JeffreyWay/laravel-mix/issues/1220

mix.setPublicPath('../').js('app.js', 'public/js')

として設定すると無事希望通りのディレクトリに出力された

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