質問編集履歴

5

試したこと3を追加しました

2018/09/03 11:39

投稿

Atsushi_Okumura
Atsushi_Okumura

スコア355

test CHANGED
File without changes
test CHANGED
@@ -350,4 +350,80 @@
350
350
 
351
351
 
352
352
 
353
+ ###試したこと3
354
+
355
+ karma.conf.jsに`webpack: require('./webpack.config'),`を追記しました。
356
+
357
+ ####karma.conf.js
358
+
359
+ ```js
360
+
361
+ preprocessors: {
362
+
363
+ './test/test.js': ['webpack']
364
+
365
+ },
366
+
367
+ webpack: require('./webpack.config'),
368
+
369
+ ```
370
+
371
+ WARNING in configuration〜のメッセージは出なくなりました。
372
+
373
+ ```
374
+
375
+ ℹ 「wdm」: wait until bundle finished: noop
376
+
377
+ 03 09 2018 20:32:08.204:WARN [karma]: No captured browser, open http://localhost:9876/
378
+
379
+ ℹ 「wdm」: Hash: 8fb8bf89b9e3a998e103
380
+
381
+ Version: webpack 4.17.1
382
+
383
+ Time: 11105ms
384
+
385
+ Built at: 2018-09-03 20:32:08
386
+
387
+ Asset Size Chunks Chunk Names
388
+
389
+ app 4.9 KiB app [emitted] app
390
+
391
+ test/test.js 45.9 KiB test/test.js [emitted] test/test.js
392
+
393
+ Entrypoint app = app
394
+
395
+ Entrypoint test/test.js = test/test.js
396
+
397
+ [./node_modules/assert/assert.js] 15.1 KiB {test/test.js} [built]
398
+
399
+ [./node_modules/inherits/inherits_browser.js] 672 bytes {test/test.js} [built]
400
+
401
+ [./node_modules/process/browser.js] 5.29 KiB {test/test.js} [built]
402
+
403
+ [./node_modules/util/support/isBufferBrowser.js] 203 bytes {test/test.js} [built]
404
+
405
+ [./node_modules/util/util.js] 15.2 KiB {test/test.js} [built]
406
+
407
+ [./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 489 bytes {test/test.js} [built]
408
+
409
+ [./src/index.js] 353 bytes {app} [built]
410
+
411
+ [./src/sample.js] 420 bytes {app} {test/test.js} [built]
412
+
413
+ [./test/test.js] 279 bytes {test/test.js} [built]
414
+
415
+ ℹ 「wdm」: Compiled successfully.
416
+
417
+ 03 09 2018 20:32:08.220:INFO [karma]: Karma v3.0.0 server started at http://0.0.0.0:9876/
418
+
419
+ 03 09 2018 20:32:08.220:INFO [launcher]: Launching browser Chrome with unlimited concurrency
420
+
421
+ 03 09 2018 20:32:08.230:INFO [launcher]: Starting browser Chrome
422
+
423
+ ```
424
+
425
+ まだテストは動かないようです。
426
+
427
+
428
+
353
429
  必要な情報があれば追記しますのでよろしくお願いします。

4

試したことを追加しました

2018/09/03 11:39

投稿

Atsushi_Okumura
Atsushi_Okumura

スコア355

test CHANGED
File without changes
test CHANGED
@@ -256,6 +256,98 @@
256
256
 
257
257
 
258
258
 
259
+ ### 試したこと2
260
+
261
+ ####package.json
262
+
263
+ `"build": "webpack --mode development"`を
264
+
265
+ `"build": "webpack --mode=development"`に変更
266
+
267
+ `"build": "webpack --mode = development"`も試してみました。
268
+
269
+ ```json
270
+
271
+ {
272
+
273
+ "name": "test-test",
274
+
275
+ "version": "1.0.0",
276
+
277
+ "main": "test.js",
278
+
279
+ "dependencies": {},
280
+
281
+ "devDependencies": {
282
+
283
+ "extract-text-webpack-plugin": "^4.0.0-beta.0",
284
+
285
+ "karma": "^3.0.0",
286
+
287
+ "karma-chrome-launcher": "^2.2.0",
288
+
289
+ "karma-cli": "^1.0.1",
290
+
291
+ "karma-mocha": "^1.3.0",
292
+
293
+ "karma-webpack": "^3.0.0",
294
+
295
+ "mocha": "^5.2.0",
296
+
297
+ "webpack": "^4.17.1",
298
+
299
+ "webpack-cli": "^3.1.0"
300
+
301
+ },
302
+
303
+ "scripts": {
304
+
305
+ "test": "karma start",
306
+
307
+ "build": "webpack --mode=development"
308
+
309
+ },
310
+
311
+ "author": "",
312
+
313
+ "license": "ISC",
314
+
315
+ "description": ""
316
+
317
+ }
318
+
319
+ ```
320
+
321
+ ####webpack.config.js
322
+
323
+ `mode: 'development',`を追加してみました。
324
+
325
+ ```js
326
+
327
+ module.exports = {
328
+
329
+ mode: 'development',
330
+
331
+ entry: {
332
+
333
+ app: 'src/index.js'
334
+
335
+ },
336
+
337
+ output: {
338
+
339
+ path: 'dist/',
340
+
341
+ filename: '[name].bundle.js'
342
+
343
+ }
344
+
345
+ };
346
+
347
+ ```
348
+
349
+ 実行してみましたがメッセージは変わらずでした。
350
+
259
351
 
260
352
 
261
353
  必要な情報があれば追記しますのでよろしくお願いします。

3

文言変更

2018/09/03 11:09

投稿

Atsushi_Okumura
Atsushi_Okumura

スコア355

test CHANGED
File without changes
test CHANGED
@@ -176,7 +176,7 @@
176
176
 
177
177
  [webpack/issues/6568](https://github.com/webpack/webpack/issues/6568#issuecomment-377491754)を参考に
178
178
 
179
- `process.traceDeprecation = true;`をkarma.config.jsに追記して実行しまし
179
+ `process.traceDeprecation = true;`をkarma.config.jsに追記、
180
180
 
181
181
  karma-webpack.jsに`process.noDeprecation = true;`を追記して`$ node test`を実行したところ
182
182
 

2

リンク名変更

2018/09/03 01:30

投稿

Atsushi_Okumura
Atsushi_Okumura

スコア355

test CHANGED
File without changes
test CHANGED
@@ -174,7 +174,7 @@
174
174
 
175
175
 
176
176
 
177
- [issue](https://github.com/webpack/webpack/issues/6568#issuecomment-377491754)を参考に
177
+ [webpack/issues/6568](https://github.com/webpack/webpack/issues/6568#issuecomment-377491754)を参考に
178
178
 
179
179
  `process.traceDeprecation = true;`をkarma.config.jsに追記して実行しまし、
180
180
 

1

いただいた回答を試した結果を追記しました。

2018/09/03 01:28

投稿

Atsushi_Okumura
Atsushi_Okumura

スコア355

test CHANGED
File without changes
test CHANGED
@@ -174,4 +174,88 @@
174
174
 
175
175
 
176
176
 
177
+ [issue](https://github.com/webpack/webpack/issues/6568#issuecomment-377491754)を参考に
178
+
179
+ `process.traceDeprecation = true;`をkarma.config.jsに追記して実行しまし、
180
+
181
+ karma-webpack.jsに`process.noDeprecation = true;`を追記して`$ node test`を実行したところ
182
+
183
+ ```
184
+
185
+ ⚠ 「wdm」: Hash: 841c81d5e12fc948407b
186
+
187
+ Version: webpack 4.17.1
188
+
189
+ Time: 11063ms
190
+
191
+ Built at: 2018-08-31 19:32:41
192
+
193
+
194
+
195
+ WARNING in configuration
196
+
197
+ The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
198
+
199
+ You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/
200
+
201
+ ℹ 「wdm」: Compiled with warnings.
202
+
203
+ ℹ 「wdm」: Compiling...
204
+
205
+ 31 08 2018 19:32:41.835:WARN [karma]: No captured browser, open http://localhost:9876/
206
+
207
+ ⚠ 「wdm」: Hash: fb8f81e72c37d049da1b
208
+
209
+ Version: webpack 4.17.1
210
+
211
+ Time: 11199ms
212
+
213
+ Built at: 2018-08-31 19:32:41
214
+
215
+ Asset Size Chunks Chunk Names
216
+
217
+ documents/works/test/test.js 13.8 KiB 0 [emitted] documents/works/test/test.js
218
+
219
+ Entrypoint documents/works/test/test.js = documents/works/test/test.js
220
+
221
+ [0] (webpack)/buildin/global.js 489 bytes {0} [built]
222
+
223
+ [1] ./documents/works/test/test.js 275 bytes {0} [built]
224
+
225
+ [2] ./node_modules/assert/assert.js 15.1 KiB {0} [built]
226
+
227
+ [3] ./node_modules/util/util.js 15.2 KiB {0} [built]
228
+
229
+ [4] ./node_modules/process/browser.js 5.29 KiB {0} [built]
230
+
231
+ [5] ./node_modules/util/support/isBufferBrowser.js 203 bytes {0} [built]
232
+
233
+ [6] ./node_modules/inherits/inherits_browser.js 672 bytes {0} [built]
234
+
235
+ [7] ./documents/works/sample.js 420 bytes {0} [built]
236
+
237
+
238
+
239
+ WARNING in configuration
240
+
241
+ The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
242
+
243
+ You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/
244
+
245
+ ℹ 「wdm」: Compiled with warnings.
246
+
247
+ 31 08 2018 19:32:41.842:INFO [karma]: Karma v3.0.0 server started at http://0.0.0.0:9876/
248
+
249
+ 31 08 2018 19:32:41.843:INFO [launcher]: Launching browser Chrome with unlimited concurrency
250
+
251
+ 31 08 2018 19:32:41.846:INFO [launcher]: Starting browser Chrome
252
+
253
+ ```
254
+
255
+ `(node:4371) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead`は出なくなりましたがテストは走っていない状態?です。
256
+
257
+
258
+
259
+
260
+
177
261
  必要な情報があれば追記しますのでよろしくお願いします。