Category : webpack

webpack.config.js //webpack.config.js const BrowserSyncPlugin = require(’browser-sync-webpack-plugin’); const ExtractTextPlugin = require(’extract-text-webpack-plugin’); const webpack = require(’webpack’); const UglifyJsPlugin = require(’uglifyjs-webpack-plugin’) module.exports = function(env) { return { entry: „./js/app.js”, output: { path: __dirname + „/dist”, filename: „main.js” }, module: { rules: [{ test: /\.scss$/, use: ExtractTextPlugin.extract({ fallback: 'style-loader’, //use: [’css-loader’, 'postcss-loader’, 'sass-loader’] use: [ { loader: „css-loader”, options: ..

Read more

npm install webpack -g webpack ./entry.js bundle.js //kompiluje plik entry.js do bundle.js Załączanie zewnętrznych plików w zewnętrznym pliku: module.exports = „It works from content.js.”; a w głównym document.write(require(„./cont..

Read more