Terra - Application
Dependencies:
- webpack
- sass-loader
Add modulePaths to your webpack.config.js:
const modulePaths = Object ;
Set sass-loader's includePaths to modulePaths in webpack.config.js:
sassLoader: includePaths: modulePaths
Set resolve root to modulePaths in webpack.config.js:
resolve: {
root: modulePaths
}
Require terra-application JS assets:
;
Require terra-application Sass assets:
Example package.json:
"dependencies": "terra-application": "file:../terra-application" "devDependencies": "css-loader": "^0.23.0" "extract-text-webpack-plugin": "^1.0.0" "node-sass": "^3.7.0" "sass-loader": "^3.2.0" "style-loader": "^0.13.0" "webpack": "^1.13.0" "scripts": "webpack": "webpack" "private": true
Example webpack.config.js:
const path = ; const ExtractTextWebpackPlugin = ; const isDevelopmentEnv = !processenvRAILS_ENV || processenvRAILS_ENV === 'development'; const modulePaths = Object ; const config = entry: application: path output: path: path filename: isDevelopmentEnv ? '[name].js' : '[name]-[hash].js' publicPath: '/assets/' resolve: root: modulePaths module: loaders: test: /\.scss$/ loader: ExtractTextWebpackPlugin plugins: isDevelopmentEnv ? '[name].css' : '[name]-[hash].css' sassLoader: includePaths: modulePaths ; moduleexports = config;
Example entry file:
// app/assets/webpack.js ;;