File: library2config.coffee

package info (click to toggle)
node-webpack 4.43.0-6%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 21,308 kB
  • sloc: javascript: 70,001; makefile: 22
file content (40 lines) | stat: -rw-r--r-- 1,121 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
webpack = require("../../");
exports.default = new Promise (resolve, reject) ->
	resolveIt = ->
		resolve
			entry:
				common: "library2/lib/common"
			output:
				hashDigestLength: 5
			module:
				rules: [
					{ test: /extra2?\.js/, loader: "raw-loader!./node_modules/extra.loader.js!val-loader?cacheable", enforce: "post" }
				]
			amd:
				fromOptions: true
			plugins: [
				new webpack.optimize.LimitChunkCountPlugin
					maxChunks: 3
				new webpack.DefinePlugin
					"typeof CONST_TYPEOF": JSON.stringify("typeof"),
					CONST_UNDEFINED: undefined,
					CONST_NULL: "null",
					CONST_TRUE: true,
					CONST_FALSE: false,
					CONST_FUNCTION: -> return "ok";
					CONST_NUMBER: 123,
					CONST_NUMBER_EXPR: "(1*100+23)",
					CONST_OBJECT: {
						A: 1,
						B: JSON.stringify("B"),
						C: -> return "C";
					}
				new webpack.ProvidePlugin
					s3: "submodule3"
				->
					this.plugin "normal-module-factory", (nmf) ->
						nmf.plugin "after-resolve", (data, callback) ->
							data.resource = data.resource.replace /extra\.js/, "extra2.js";
							callback null, data;
			]
	setTimeout resolveIt, 300