Last active
January 8, 2017 12:09
-
-
Save TheHatSky/5c8c3f6e55b3639a0b157ce74bedaba2 to your computer and use it in GitHub Desktop.
Шаблон webpack.config.part.js
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
'use strict'; | |
module.exports = (basePath, requirements) => { | |
const path = requirements.path; | |
const baseDir = path.join(basePath, 'Scripts' , 'webpack'); | |
return { | |
entry: { | |
// Путь к файлу относительно папки проекта: ./Scripts/webpack/dialog/dialog.tsx. | |
'dialog': path.join(baseDir, 'dialog', 'dialog.tsx') | |
}, | |
output: { | |
// Положим все в папку ./dist. | |
path: path.join(baseDir, 'dist'), | |
// Для entry 'dialog' будет 'dialog.bundle.js'. | |
filename: '[name].bundle.js', | |
sourceMapFilename: '[name].js.map' | |
}, | |
externals: { | |
// В данном случае импорты "react", "react-dom" и "react-dom-server" будут заменены | |
// на использование глобальных перменных "React", "ReactDOM" и "ReactDOMServer" соответственно. | |
"react": "React", | |
"react-dom": "ReactDOM", | |
"react-dom-server": "ReactDOMServer" | |
} | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment