Skip to content

Instantly share code, notes, and snippets.

@LeezQ
Last active August 29, 2015 14:16
Show Gist options
  • Save LeezQ/a16d668dd28a855a5f6f to your computer and use it in GitHub Desktop.
Save LeezQ/a16d668dd28a855a5f6f to your computer and use it in GitHub Desktop.
webpack demo file
module.exports = {
entry: {
config_index: "./src/config_event/config_index.js",
new_event: "./src/new_event/new_event.js",
event_list: "./src/event_list/event_list.js",
},
output: {
path: 'dist/src' ,
filename: "[name].js"
},
externals: {
'react': 'window.React'
},
module: {
loaders: [
{ test: /\.less$/, loader: 'style-loader!css-loader!less-loader' },
{ test: /\.css$/, loader: "style!css" },
{ test: /\.(js|jsx)$/, loader: 'jsx-loader?harmony' },
{ test: /\.(jpg|png)$/, loader: "file-loader?name=[path][name].[ext]" } //如果是图片,使用 file-loader
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment