Last active
May 17, 2016 09:33
-
-
Save shangoyanyi/c8c40e525cbc90d424e95213b04117d3 to your computer and use it in GitHub Desktop.
webpack config with multi-entry and multi-output-path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require("webpack"); | |
module.exports = { | |
entry:{ | |
//左邊字串就是下方 output 區塊的 [name],透過這種方式就可以把檔案輸出到不同路徑下 | |
'popup/popup' : './app/main/src/pages/popup/popup.js', | |
'settings/settings' : './app/main/src/pages/settings/settings.js' | |
}, | |
output: { | |
filename: '[name].bundle.js', | |
path: __dirname + '/app/main/src/pages/', | |
publicPath: "/app/main/src/pages/" | |
}, | |
module: { | |
loaders: [{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
loader: 'babel-loader', | |
query: { | |
presets: ['es2015', 'react'] | |
} | |
}] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment