PluginProbe
Edit Flow / 0.9
Edit Flow v0.9
0.11.1 0.11.0 0.7.2 0.7.3 0.7.4 0.7.5 0.7.6 0.8 0.8.1 0.8.2 0.9 0.9.1 0.9.2 0.9.3 0.9.4 0.9.5 0.9.6 0.9.7 0.9.8 0.9.9 trunk 0.1.5 0.10.0 0.10.1 0.10.2 All 44 releases
edit-flow / webpack.config.js

webpack.config.js in Edit Flow 0.9, at webpack.config.js

74 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var ExtractText = require('extract-text-webpack-plugin');
2 var debug = process.env.NODE_ENV !== 'production';
3 var glob = require("glob");
4
5 const entries = glob.sync("./blocks/src/**/block.js").reduce((acc, item) => {
6 const name = item.replace( /blocks\/src\/(.*)\/block.js/, '$1' )
7 acc[ name ] = item;
8 return acc;
9 }, {});
10
11 // @todo
12 var extractEditorSCSS = new ExtractText({
13 filename: './[name].editor.build.css'
14 });
15
16 var extractBlockSCSS = new ExtractText({
17 filename: './[name].style.build.css'
18 });
19
20 var plugins = [extractEditorSCSS, extractBlockSCSS];
21
22 var scssConfig = {
23 use: [
24 {
25 loader: 'css-loader'
26 },
27 {
28 loader: 'sass-loader',
29 options: {
30 outputStyle: 'compressed'
31 }
32 }
33 ]
34 };
35
36 module.exports = {
37 context: __dirname,
38 devtool: debug ? 'sourcemap' : null,
39 mode: debug ? 'development' : 'production',
40 // entry: './blocks/src/blocks.js',
41 entry: entries,
42 output: {
43 path: __dirname + '/blocks/dist/',
44 filename: "[name].build.js"
45 },
46 externals: {
47 'react': "React",
48 "react-dom": "ReactDOM"
49 },
50 module: {
51 rules: [
52 {
53 test: /\.js$/,
54 exclude: /node_modules/,
55 use: [
56 {
57 loader: 'babel-loader'
58 }
59 ]
60 },
61 {
62 test: /editor\.scss$/,
63 exclude: /node_modules/,
64 use: extractEditorSCSS.extract(scssConfig)
65 },
66 {
67 test: /style\.scss$/,
68 exclude: /node_modules/,
69 use: extractBlockSCSS.extract(scssConfig)
70 }
71 ]
72 },
73 plugins: plugins
74 };